summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2017-04-18 14:24:06 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2017-04-28 23:12:52 +0100
commit66448b0a666b4a5ca4bfe34f22174805cd0784de (patch)
tree3966d0ddbbd560f2ef4b33d67ec3f64192c79283
parenta7068d931eb8208e8c5eddb0bc9b8a651152229c (diff)
downloadgtk+-66448b0a666b4a5ca4bfe34f22174805cd0784de.tar.gz
build: Generate the appropriate GLib versioning checks
The autotools build checks the version of GLib we are depending on in order to generate the appropriate GLIB_VERSION values for the min-required/max-allowed defines.
-rw-r--r--meson.build20
1 files changed, 17 insertions, 3 deletions
diff --git a/meson.build b/meson.build
index fef52f2ca2..ca20b0e8c7 100644
--- a/meson.build
+++ b/meson.build
@@ -7,9 +7,23 @@ project('gtk+-4.0', 'c',
meson_version : '>= 0.39.1',
license: 'LGPLv2.1+')
-glib_req = '>= 2.49.4'
-glib_min_required = 'GLIB_VERSION_2_48'
-glib_max_allowed = 'GLIB_VERSION_2_50'
+glib_major_req = 2
+glib_minor_req = 49
+glib_micro_req = 4
+
+if glib_minor_req.is_odd()
+ glib_min_required = 'GLIB_VERSION_@0@_@1@'.format(glib_major_req, glib_minor_req - 1)
+else
+ glib_min_required = 'GLIB_VERSION_@0@_@1@'.format(glib_major_req, glib_minor_req)
+endif
+
+if glib_minor_req.is_odd()
+ glib_max_allowed = 'GLIB_VERSION_@0@_@1@'.format(glib_major_req, glib_minor_req + 1)
+else
+ glib_max_allowed = 'GLIB_VERSION_@0@_@1@'.format(glib_major_req, glib_minor_req)
+endif
+
+glib_req = '>= @0@.@1@.@2@'.format(glib_major_req, glib_minor_req, glib_micro_req)
pango_req = '>= 1.37.3'
atk_req = '>= 2.15.1'
cairo_req = '>= 1.14.0'