summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorChristian Hergert <chergert@redhat.com>2019-10-24 14:35:32 -0700
committerChristian Hergert <chergert@redhat.com>2019-10-24 14:35:32 -0700
commitf5532e6b7cf6472bd70d06332ebd55342ff362bc (patch)
treec27ed3c795e43bc032c7c3e9051bf8f26ffbf178 /meson.build
parentd977962aaafc3d4294729063697d273bc7d24852 (diff)
downloadlibpeas-f5532e6b7cf6472bd70d06332ebd55342ff362bc.tar.gz
build: specify min/max glib versions in meson.build
This ensures that we don't use API that we cannot use, but also ensures that we don't need to litter the source code with begin/end ignore deprecations.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build13
1 files changed, 12 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index 14dadf4..fae3e7f 100644
--- a/meson.build
+++ b/meson.build
@@ -83,7 +83,9 @@ config_h.set_quoted('GETTEXT_PACKAGE', package_string)
# Dependencies
cc = meson.get_compiler('c')
-glib_req = '>= 2.38.0'
+glib_req_version = '2.38.0'
+
+glib_req = '>= @0@'.format(glib_req_version)
introspection_req = '>= 1.39.0'
gtk_req = '>= 3.0.0'
gtk_doc_req = '>= 1.11'
@@ -119,6 +121,15 @@ luajit_dep = dependency('luajit', version: luajit_req, required: false)
luajit_prg = find_program('luajit', required: false)
xmllint_prg = find_program('xmllint', required: false)
+glib_version_arr = glib_req_version.split('.')
+glib_major_version = glib_version_arr[0]
+glib_minor_version = glib_version_arr[1]
+
+add_project_arguments([
+ '-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_@0@_@1@'.format(glib_major_version, glib_minor_version),
+ '-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_@0@_@1@'.format(glib_major_version, glib_minor_version),
+], language: 'c')
+
if build_machine.system() == 'darwin'
config_h.set_quoted('OS_OSX', 1)
endif