From: Simon McVittie Date: Tue, 6 Jun 2023 12:07:04 +0000 (+0100) Subject: meson: Disable some warnings when asserts/checks are disabled X-Git-Tag: dbus-1.15.8~38^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fmerge-requests%2F412%2Fhead;p=thirdparty%2Fdbus.git meson: Disable some warnings when asserts/checks are disabled 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 --- diff --git a/meson.build b/meson.build index 5b61b047d..433a333d8 100644 --- a/meson.build +++ b/meson.build @@ -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)