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 <smcv@collabora.com>
This commit is contained in:
Simon McVittie 2023-06-06 13:07:04 +01:00
parent 2ca68e9544
commit ba515347cf

View 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)