diff options
author | Andoni Morales Alastruey <ylatuya@gmail.com> | 2022-10-18 11:18:06 +0200 |
---|---|---|
committer | Andoni Morales Alastruey <ylatuya@gmail.com> | 2023-01-27 15:50:47 +0100 |
commit | b4c454a75108bc31934d2d0be0141a2220bded84 (patch) | |
tree | dfbf62bc4ec449570d7304b4941bc5d93ca79674 | |
parent | 7fdf9c9134c5a2e1525d97b6f3bbf2c83bd3a115 (diff) | |
download | gobject-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
-rw-r--r-- | gir/meson.build | 5 | ||||
-rw-r--r-- | meson.build | 10 | ||||
-rw-r--r-- | tests/meson.build | 1 |
3 files changed, 16 insertions, 0 deletions
diff --git a/gir/meson.build b/gir/meson.build index da23e422..09714cc1 100644 --- a/gir/meson.build +++ b/gir/meson.build @@ -239,6 +239,7 @@ glib_gir = custom_target('gir-glib', depend_files: gir_giscanner_built_files, install: true, install_dir: girdir, + env: g_ir_scanner_env, command: glib_command + [ '--cflags-begin'] + glib_includes + extra_giscanner_cflags + [ '-DGLIB_COMPILATION', @@ -307,6 +308,7 @@ gobject_gir = custom_target('gir-gobject', depend_files: gir_giscanner_built_files, install: true, install_dir: girdir, + env: g_ir_scanner_env, command: gobject_command + [ '--include-uninstalled=' + glib_gir.full_path(), '--cflags-begin'] + glib_includes + extra_giscanner_cflags + [ @@ -360,6 +362,7 @@ gir_files += custom_target('gir-gmodule', depend_files: gir_giscanner_built_files, install: true, install_dir: girdir, + env: g_ir_scanner_env, command: gmodule_command + [ '--include-uninstalled=' + glib_gir.full_path(), '--cflags-begin'] + glib_includes + extra_giscanner_cflags + [ @@ -456,6 +459,7 @@ gio_gir = custom_target('gir-gio', depend_files: gir_giscanner_built_files, install: true, install_dir: girdir, + env: g_ir_scanner_env, command: gio_command + [ '--include-uninstalled=' + gobject_gir.full_path(), '--cflags-begin'] + glib_includes + extra_giscanner_cflags + [ @@ -493,6 +497,7 @@ gir_files += custom_target('gir-girepository', depend_files: gir_giscanner_built_files, install: true, install_dir: girdir, + env: g_ir_scanner_env, command: girepository_command + [ '--include-uninstalled=' + gobject_gir.full_path(), '--cflags-begin'] + glib_includes + extra_giscanner_cflags + [ 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' diff --git a/tests/meson.build b/tests/meson.build index abb51f58..22b402b0 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -56,6 +56,7 @@ test_gircompiler = find_program('g-ir-compiler', native: false, required : false test_everything_files = custom_target('everything', output: ['everything.h', 'everything.c'], depends: typelibs, + env: g_ir_scanner_env, command: [ test_girscanner, '--quiet', |