From e8d11b0dbdb35c503a16784f18e675d67e3a7481 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 26 Jun 2024 12:48:32 +0100 Subject: [PATCH] introspection: Add libgirepository as a dep to all generate_gir() calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit libgirepository is not needed by most of the modules, but it is needed by the `g-ir-scanner` generated dumper program. If we don’t explicitly include the local version of it here, Meson will implicitly link against it anyway, and that might pull in a different version, or try to link against a half-built local version as the build ordering dependency tree won’t reflect this relationship. Signed-off-by: Philip Withnall Fixes: #3401 --- girepository/introspection/meson.build | 32 +++++++++++++++++++------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/girepository/introspection/meson.build b/girepository/introspection/meson.build index 802a22edb..0b11e7431 100644 --- a/girepository/introspection/meson.build +++ b/girepository/introspection/meson.build @@ -7,6 +7,16 @@ gi_gen_shared_sources = [ gmodule_visibility_h, ] +gi_gen_shared_dependencies = [ + # libgirepository is not needed by most of the modules below, but it is needed + # by the g-ir-scanner generated dumper program. If we don’t explicitly include + # the local version of it here, Meson will implicitly link against it anyway, + # and that might pull in a different version, or try to link against a + # half-built local version as the build ordering dependency tree won’t + # reflect this relationship. + libgirepository_dep, +] + gi_gen_env_variables = environment() if get_option('b_sanitize') != 'none' @@ -50,7 +60,7 @@ glib_gir = gnome.generate_gir(libglib, header: 'glib.h', install: true, install_dir_gir: glib_girdir, - dependencies: [ + dependencies: gi_gen_shared_dependencies + [ libgobject_dep, ], env: gi_gen_env_variables, @@ -78,7 +88,7 @@ if host_system == 'windows' includes: [ glib_gir[0] ], install: true, install_dir_gir: glib_girdir, - dependencies: [ + dependencies: gi_gen_shared_dependencies + [ libgobject_dep, ], env: gi_gen_env_variables, @@ -107,7 +117,7 @@ else includes: [ glib_gir[0] ], install: true, install_dir_gir: glib_girdir, - dependencies: [ + dependencies: gi_gen_shared_dependencies + [ libgobject_dep, ], env: gi_gen_env_variables, @@ -141,6 +151,7 @@ gobject_gir = gnome.generate_gir(libgobject, includes: [ glib_gir[0] ], install: true, install_dir_gir: glib_girdir, + dependencies: gi_gen_shared_dependencies, env: gi_gen_env_variables, extra_args: gir_args + [ '-DGOBJECT_COMPILATION', @@ -167,7 +178,7 @@ gmodule_gir = gnome.generate_gir(libgmodule, includes: [ glib_gir[0] ], install: true, install_dir_gir: glib_girdir, - dependencies: [ + dependencies: gi_gen_shared_dependencies + [ libglib_dep, ], env: gi_gen_env_variables, @@ -230,7 +241,7 @@ gio_gir = gnome.generate_gir(libgio, includes: [ glib_gir[0], gmodule_gir[0], gobject_gir[0] ], install: true, install_dir_gir: glib_girdir, - dependencies: [ + dependencies: gi_gen_shared_dependencies + [ libglib_dep, libgobject_dep, libgmodule_dep, @@ -256,7 +267,7 @@ if host_system == 'windows' includes: [ glib_gir[0], gmodule_gir[0], gobject_gir[0], gio_gir[0] ], install: true, install_dir_gir: glib_girdir, - dependencies: [ + dependencies: gi_gen_shared_dependencies + [ libglib_dep, libgobject_dep, libgmodule_dep, @@ -286,7 +297,7 @@ else includes: [ glib_gir[0], gmodule_gir[0], gobject_gir[0], gio_gir[0] ], install: true, install_dir_gir: glib_girdir, - dependencies: [ + dependencies: gi_gen_shared_dependencies + [ libglib_dep, libgobject_dep, libgmodule_dep, @@ -325,7 +336,12 @@ girepository_gir = gnome.generate_gir(libgirepository, includes: [ glib_gir[0], gmodule_gir[0], gobject_gir[0], gio_gir[0] ], install: true, install_dir_gir: glib_girdir, - dependencies: [ libglib_dep, libgobject_dep, libgmodule_dep, libgio_dep ], + dependencies: gi_gen_shared_dependencies + [ + libglib_dep, + libgobject_dep, + libgmodule_dep, + libgio_dep, + ], extra_args: gir_args + libgirepository_gir_args, )