]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
meson: Allow disabling Valgrind instrumentation
authorSimon McVittie <smcv@collabora.com>
Tue, 28 Jun 2022 12:23:31 +0000 (13:23 +0100)
committerSimon McVittie <smcv@collabora.com>
Wed, 13 Jul 2022 19:36:13 +0000 (20:36 +0100)
This would currently result in a hard dependency on Valgrind headers
when linking dependent projects to libdbus (see
https://github.com/mesonbuild/meson/pull/10544 for an attempt to
avoid this), so distributions likely don't want to enable this feature
in their main builds of valgrind (although they could enable it in
special debug builds like the one in Debian's dbus-tests package if
desired).

Signed-off-by: Simon McVittie <smcv@collabora.com>
meson.build
meson_options.txt

index 7fde9c9cddae658a49dcdb91f0fbb5d324c7b06a..923c12a9ffa18e7dcf022e3163623d8f63f967f2 100644 (file)
@@ -487,7 +487,11 @@ int main() {
 ''')
 config.set('HAVE_UNIX_FD_PASSING', has_scm_rights)
 
-valgrind = dependency('valgrind', version: '>=3.6', required: false)
+valgrind = dependency(
+    'valgrind',
+    version: '>=3.6',
+    required: get_option('valgrind'),
+)
 config.set('WITH_VALGRIND', valgrind.found())
 
 if platform_win32ce
index 4babdd65f54f5d5dec1545b56c8b3b53559d05e4..770082eaaf7e65f9368118864b7c9f293ed1928c 100644 (file)
@@ -264,6 +264,13 @@ option(
   description: 'Enable user-session semantics for session bus under systemd'
 )
 
+option(
+  'valgrind',
+  type: 'feature',
+  value: 'disabled',
+  description: 'Build with Valgrind instrumentation (note that this currently adds a hard dependency on valgrind)'
+)
+
 option(
   'verbose_mode',
   type: 'boolean',