summaryrefslogtreecommitdiff
path: root/gmodule
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2020-04-05 00:34:04 -0400
committerXavier Claessens <xavier.claessens@collabora.com>2020-04-05 00:34:04 -0400
commit10280deebdb6bfa96e24325548c15a6085d6bdf2 (patch)
treee20a8c191d634f738c1ff1040287add6c109284c /gmodule
parent1a3a1865ebd5b8789f7aa981329c29838af38836 (diff)
downloadglib-10280deebdb6bfa96e24325548c15a6085d6bdf2.tar.gz
Meson: Override every dependency glib provides
Meson 0.54.0 added a new method meson.override_dependency() that must be used to ensure dependency consistency. This patch ensures a project that depends on glib will never link to a mix of system and subproject libraries. It would happen in such cases: The system has glib 2.40 installed, and a project does: dependency('glib-2.0', version: '>=2.60', fallback: ['glib', 'glib_dep']) dependency('gobject-2.0') The first call will configure glib subproject because the system libglib is too old, but the 2nd call will return system libgobject. By overriding 'gobject-2.0' dependency while configuring glib subproject during the first call, meson knows that on the 2nd call it must return the subproject dependency instead of system dependency. This also has the nice side effect that with Meson >0.54.0 an application depending on glib can declare the fallback without knowing the dependency variable name: dependency('glib-2.0', fallback: 'glib').
Diffstat (limited to 'gmodule')
-rw-r--r--gmodule/meson.build6
1 files changed, 6 insertions, 0 deletions
diff --git a/gmodule/meson.build b/gmodule/meson.build
index 9801c9476..b1a5a11a9 100644
--- a/gmodule/meson.build
+++ b/gmodule/meson.build
@@ -120,3 +120,9 @@ pkg.generate(libraries : [libgmodule, export_dynamic_ldflags],
libgmodule_dep = declare_dependency(link_with : libgmodule,
include_directories : [gmoduleinc],
dependencies : [libglib_dep])
+
+if meson.version().version_compare('>=0.54.0')
+ meson.override_dependency('gmodule-no-export-2.0', libgmodule_dep)
+ meson.override_dependency('gmodule-export-2.0', libgmodule_dep)
+ meson.override_dependency('gmodule-2.0', libgmodule_dep)
+endif