girepository: Export builddir typelib and GIR paths

These can then be used by a parent project if GLib is used as a Meson
subproject.

In particular, GJS wants to use `GLib-2.0.typelib`
from GLib-as-a-subproject, but doesn’t want to hardcode the path to it
inside the GLib builddir.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Fixes: #3244
This commit is contained in:
Philip Withnall 2024-02-05 15:51:48 +00:00
parent bcc22d48b0
commit 57c02e4c07

View File

@ -207,6 +207,13 @@ libgirepository_dep = declare_dependency(
dependencies: [libglib_dep, libgobject_dep, libgio_dep, libgmodule_dep],
sources: [gi_visibility_h],
include_directories: [girepoinc],
variables: {
# Export the path for the built GLib-2.0.typelib (etc.) for when GLib is
# used as a subproject. The variable names match those in
# pkgconfig_variables below.
'girdir': meson.current_build_dir() / 'introspection',
'typelibdir': meson.current_build_dir() / 'introspection',
},
)
executable('gi-dump-types',