meson: Add GLib version macros

This helps to avoid unintended dependencies on newer versions of GLib.

Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Simon McVittie 2022-06-28 12:50:32 +01:00
parent 6a4835e627
commit 154cc9d5ca

View file

@ -691,6 +691,9 @@ config.set('DBUS_ENABLE_CHECKS', checks ? 1 : false)
config.set('DBUS_DISABLE_CHECKS', not checks ? 1 : false)
config.set('G_DISABLE_CHECKS', not checks ? 1 : false)
config.set('HAVE_GIO_UNIX', have_gio_unix ? 1 : false)
# Ignore post-2.38 deprecations, prevent use of post-2.44 APIs.
config.set('GLIB_VERSION_MIN_REQUIRED', 'GLIB_VERSION_2_38')
config.set('GLIB_VERSION_MAX_ALLOWED', 'G_ENCODE_VERSION(2,44)')
dbus_static_flags = ( get_option('default_library') == 'static'
? '-DDBUS_STATIC_BUILD'