]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
meson: Disable some warnings when asserts/checks are disabled 412/head
authorSimon McVittie <smcv@collabora.com>
Tue, 6 Jun 2023 12:07:04 +0000 (13:07 +0100)
committerSimon McVittie <smcv@collabora.com>
Wed, 7 Jun 2023 12:09:31 +0000 (12:09 +0000)
Some labels are only used when checks are enabled, and some variables
are only used when assertions and/or checks are enabled. Instead of
cluttering the code with extra #ifdefs, we silence those warnings:
they're harmless in this case. We already do this in Autotools.

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

index 5b61b047d0ddb3cdef407ce08732a7e1df9f5128..433a333d89ffb6dc4c7bd51499705b867ecddb96 100644 (file)
@@ -791,13 +791,10 @@ endif
 
 if not asserts
     warning_args += [
-        '-Wno-unused-but-set-variable',
-        '-Wno-unused-variable',
         '-Wno-unused-function',
     ]
 endif
 
-
 checks = get_option('checks')
 config.set('DBUS_ENABLE_CHECKS', checks ? 1 : false)
 config.set('DBUS_DISABLE_CHECKS', not checks ? 1 : false)
@@ -807,6 +804,19 @@ config.set('HAVE_GIO_UNIX', have_gio_unix ? 1 : false)
 config.set('GLIB_VERSION_MIN_REQUIRED', 'GLIB_VERSION_2_38')
 config.set('GLIB_VERSION_MAX_ALLOWED', 'G_ENCODE_VERSION(2,44)')
 
+if not checks
+    warning_args += [
+        '-Wno-unused-label',
+    ]
+endif
+
+if not (asserts and checks)
+    warning_args += [
+        '-Wno-unused-but-set-variable',
+        '-Wno-unused-variable',
+    ]
+endif
+
 windows_output_debug = get_option('windows_output_debug_string')
 config.set('DBUS_USE_OUTPUT_DEBUG_STRING', windows_output_debug)