diff options
author | Benjamin Berg <bberg@redhat.com> | 2020-07-13 16:15:14 +0200 |
---|---|---|
committer | Benjamin Berg <bberg@redhat.com> | 2020-07-13 16:21:22 +0200 |
commit | db9cefd0fcea6909134e92c844f4f6b515eaf5a3 (patch) | |
tree | b03ba6ba727e130adbf67f5f838dd6a2e6f73ecf | |
parent | c3b841fb5c74f876e0f3b2097b5d4af466fea7ef (diff) | |
download | gnome-settings-daemon-db9cefd0fcea6909134e92c844f4f6b515eaf5a3.tar.gz |
meson: Enable GLib API version checking macros
Hopefully this can catch issues again where we accidentally start to
depend on a newer GLib version than we intended to.
-rw-r--r-- | meson.build | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/meson.build b/meson.build index 851341d7..7fa3efe8 100644 --- a/meson.build +++ b/meson.build @@ -13,6 +13,11 @@ gsd_api_version_minor = 0 gsd_api_version = '@0@.@1@'.format(gsd_major_version, gsd_api_version_minor) gsd_api_name = '@0@-@1@'.format(meson.project_name(), gsd_api_version) +glib_min_version = '2.56' + +glib_version_def = 'GLIB_VERSION_@0@_@1@'.format( + glib_min_version.split('.')[0], glib_min_version.split('.')[1]) + gsd_prefix = get_option('prefix') gsd_bindir = join_paths(gsd_prefix, get_option('bindir')) gsd_datadir = join_paths(gsd_prefix, get_option('datadir')) @@ -66,7 +71,9 @@ if gsd_buildtype.contains('debug') '-Wnested-externs', '-Wno-strict-aliasing', '-Wno-sign-compare', - '-Wpointer-arith' + '-Wpointer-arith', + '-DGLIB_VERSION_MIN_REQUIRED=' + glib_version_def, + '-DGLIB_VERSION_MAX_ALLOWED=' + glib_version_def, ] compiler_flags = cc.get_supported_arguments(test_cflags) @@ -82,7 +89,7 @@ endif add_project_arguments(common_flags + compiler_flags, language: 'c') -glib_dep = dependency('glib-2.0', version: '>= 2.56') +glib_dep = dependency('glib-2.0', version: '>=' + glib_min_version) colord_dep = dependency('colord', version: '>= 1.3.5') geocode_glib_dep = dependency('geocode-glib-1.0', version: '>= 3.10.0') gio_dep = dependency('gio-2.0', version: '>= 2.53.0') |