From a26f16f2ef682cf4c9bb9ff219311382d0699122 Mon Sep 17 00:00:00 2001 From: Romain Malmain Date: Tue, 21 Nov 2023 12:06:32 +0100 Subject: [PATCH] Add an option to not build tests Seems to have no impact and saves the compilation of 1000 files. --- meson.build | 11 ++++++++--- meson_options.txt | 2 ++ scripts/meson-buildoptions.sh | 2 ++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 1eec896336..0a068ead86 100644 --- a/meson.build +++ b/meson.build @@ -3518,8 +3518,10 @@ subdir('bsd-user') subdir('linux-user') # needed for fuzzing binaries -subdir('tests/qtest/libqos') -subdir('tests/qtest/fuzz') +if get_option('tests') + subdir('tests/qtest/libqos') + subdir('tests/qtest/fuzz') +endif # accel modules tcg_real_module_ss = ss.source_set() @@ -4045,7 +4047,9 @@ subdir('scripts') subdir('tools') subdir('pc-bios') subdir('docs') -subdir('tests') +if get_option('tests') + subdir('tests') +endif if gtk.found() subdir('po') endif @@ -4141,6 +4145,7 @@ if enable_modules summary_info += {'alternative module path': get_option('module_upgrades')} endif summary_info += {'fuzzing support': get_option('fuzzing')} +summary_info += {'tests support': get_option('tests')} if have_system summary_info += {'Audio drivers': ' '.join(audio_drivers_selected)} endif diff --git a/meson_options.txt b/meson_options.txt index c9baeda639..6aa0caa5b2 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -43,6 +43,8 @@ option('docs', type : 'feature', value : 'auto', description: 'Documentations build support') option('fuzzing', type : 'boolean', value: false, description: 'build fuzzing targets') +option('tests', type : 'boolean', value: true, + description: 'build tests') option('gettext', type : 'feature', value : 'auto', description: 'Localization of the GTK+ user interface') option('modules', type : 'feature', value : 'disabled', diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index 680fa3f581..22216d922a 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -315,6 +315,8 @@ _meson_option_parse() { --disable-fuse-lseek) printf "%s" -Dfuse_lseek=disabled ;; --enable-fuzzing) printf "%s" -Dfuzzing=true ;; --disable-fuzzing) printf "%s" -Dfuzzing=false ;; + --enable-tests) printf "%s" -Dtests=true ;; + --disable-tests) printf "%s" -Dtests=false ;; --enable-gcrypt) printf "%s" -Dgcrypt=enabled ;; --disable-gcrypt) printf "%s" -Dgcrypt=disabled ;; --enable-gettext) printf "%s" -Dgettext=enabled ;;