From: Simon McVittie Date: Thu, 23 Jun 2022 19:03:47 +0000 (+0100) Subject: build: Make modular_tests an auto feature X-Git-Tag: dbus-1.15.0~32^2~89 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=29a20c32845e4db702d5ffb7202b24c915eec854;p=thirdparty%2Fdbus.git build: Make modular_tests an auto feature These don't alter the contents of the non-test executables, so we can safely enable them whenever GLib is available. Signed-off-by: Simon McVittie --- diff --git a/meson.build b/meson.build index 8b871c445..adcd15566 100644 --- a/meson.build +++ b/meson.build @@ -282,11 +282,13 @@ data_config.set('top_builddir', meson.project_build_root()) threads = dependency('threads') config.set('HAVE_MONOTONIC_CLOCK', cc.has_header_symbol('pthread.h', 'CLOCK_MONOTONIC')) -glib = dependency('glib-2.0', version: '>=2.40', required: false) +glib = dependency( + 'glib-2.0', version: '>=2.40', required: get_option('modular_tests'), +) if platform_windows - gio = dependency('gio-windows-2.0', required: false) + gio = dependency('gio-windows-2.0', required: glib.found()) else - gio = dependency('gio-unix-2.0', required: false) + gio = dependency('gio-unix-2.0', required: glib.found()) endif use_glib = glib.found() and gio.found() config.set('DBUS_WITH_GLIB', use_glib) @@ -678,7 +680,7 @@ config.set('DBUS_ENABLE_EMBEDDED_TESTS', embedded_tests) # default (unless you don't have GLib), because they don't bloat the library # or binaries. dbus_enable_modular_tests = ( - get_option('modular_tests') + not get_option('modular_tests').disabled() and glib.version().version_compare('>=2.40') and gio.found() ) diff --git a/meson_options.txt b/meson_options.txt index 56969b2a5..d628ad1f5 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -144,8 +144,8 @@ option( option( 'modular_tests', - type: 'boolean', - value: false, + type: 'feature', + value: 'auto', description: 'Enable modular regression tests (requires GLib)' )