summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorAndoni Morales Alastruey <ylatuya@gmail.com>2022-10-18 11:18:06 +0200
committerAndoni Morales Alastruey <ylatuya@gmail.com>2023-01-27 15:50:47 +0100
commitb4c454a75108bc31934d2d0be0141a2220bded84 (patch)
treedfbf62bc4ec449570d7304b4941bc5d93ca79674 /meson.build
parent7fdf9c9134c5a2e1525d97b6f3bbf2c83bd3a115 (diff)
downloadgobject-introspection-b4c454a75108bc31934d2d0be0141a2220bded84.tar.gz
Fix gir build when using subprojects' dependencies
https://github.com/mesonbuild/meson/pull/10275 introduced support in meson to use uninstalled .pc files in the meson-uninstalled directory to resolve dependencies built with subprojects. Replicate the same solution while all the custom_target are migrated to gnome.generate_dir
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build10
1 files changed, 10 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index ca9c2b22..28fbf7fe 100644
--- a/meson.build
+++ b/meson.build
@@ -151,6 +151,16 @@ if not (host_system == 'darwin' and host_arch == 'aarch64' or
config.set('LEGACY_GIRFFI_FREE', 1)
endif
+# Replicate https://github.com/mesonbuild/meson/pull/10275 setting
+# the correct env in the custom_target
+pkg_config = find_program('pkg-config')
+g_ir_scanner_env = environment()
+dep_type = glib_dep.type_name()
+if dep_type == 'internal'
+ g_ir_scanner_env.append('PKG_CONFIG_PATH', meson.global_build_root() + '/meson-uninstalled')
+ g_ir_scanner_env.set('PKG_CONFIG', pkg_config.full_path())
+endif
+
configure_file(
configuration: config,
output: 'config.h'