diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2022-04-13 09:35:52 -0400 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2022-04-30 15:01:28 -0400 |
commit | ca77adea89b3f102ca3e62465f651811516071f5 (patch) | |
tree | a5afd75910aac7eb23b31874840193047b511005 | |
parent | 18bec0d3e31884dc493a03741b2ec9fef17047ee (diff) | |
download | meson-ca77adea89b3f102ca3e62465f651811516071f5.zip meson-ca77adea89b3f102ca3e62465f651811516071f5.tar.gz meson-ca77adea89b3f102ca3e62465f651811516071f5.tar.bz2 |
gnome: Make sure g-ir-scanner can use pkg-config properly
We need to setup the environment we pass to g-ir-scanner because it will
try to use pkg-config to find dependencies, and that must respect user
settings from machine file. Also make it use uninstalled pc files Meson
generated in the case dependencies, such as glib, have been built as
subproject.
-rw-r--r-- | mesonbuild/modules/gnome.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index ed07aa8..d502187 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -967,6 +967,13 @@ class GnomeModule(ExtensionModule): elif install_dir is False: install = False + # g-ir-scanner uses pkg-config to find libraries such as glib. They could + # be built as subproject in which case we need to trick it to use + # -uninstalled.pc files Meson generated. It also must respect pkgconfig + # settings user could have set in machine file, like PKG_CONFIG_LIBDIR, + # SYSROOT, etc. + run_env = PkgConfigDependency.get_env(state.environment, MachineChoice.HOST, uninstalled=True) + return GirTarget( girfile, state.subdir, @@ -980,6 +987,7 @@ class GnomeModule(ExtensionModule): install=install, install_dir=[install_dir], install_tag=['devel'], + env=run_env, ) @staticmethod |