]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
build: Make modular_tests an auto feature
authorSimon McVittie <smcv@collabora.com>
Thu, 23 Jun 2022 19:03:47 +0000 (20:03 +0100)
committerSimon McVittie <smcv@collabora.com>
Wed, 13 Jul 2022 19:36:13 +0000 (20:36 +0100)
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 <smcv@collabora.com>
meson.build
meson_options.txt

index 8b871c445f3dcf3e7b32105fd2f78bc3e7d1abc2..adcd15566da9734d71d712c97e2772d3ac74af88 100644 (file)
@@ -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()
 )
index 56969b2a5c6aaf929590266d8e8ad827239178b6..d628ad1f537a307b479068b791568f1a52410ab6 100644 (file)
@@ -144,8 +144,8 @@ option(
 
 option(
   'modular_tests',
-  type: 'boolean',
-  value: false,
+  type: 'feature',
+  value: 'auto',
   description: 'Enable modular regression tests (requires GLib)'
 )