From f83c3e2d9f5ef03033c10cbd9ecf28ab81013d17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Fri, 10 May 2024 04:55:57 +0200 Subject: [PATCH] girepository: Always use currently built GLib to run g-ir-scanner If we use the system libraries we can't really debug it, so ensure we're using the currently built libraries for it too. We're doing it globally to ensure that we're testing the result that this version of the libraries are building --- girepository/introspection/meson.build | 6 ++++++ meson.build | 2 ++ 2 files changed, 8 insertions(+) diff --git a/girepository/introspection/meson.build b/girepository/introspection/meson.build index e94af9196..7b296283b 100644 --- a/girepository/introspection/meson.build +++ b/girepository/introspection/meson.build @@ -19,6 +19,12 @@ gi_gen_shared_dependencies = [ gi_gen_env_variables = environment() +# Use currently built libraries to run g-ir-scanner and the various tools +# this may not happen if we don't set the library paths. +gi_gen_env_variables.prepend(glib_exec_var_library_path, + fs.parent(libglib.full_path()), fs.parent(libgobject.full_path()), + fs.parent(libgmodule.full_path()), fs.parent(libgio.full_path())) + if 'address' in glib_sanitizers gi_gen_env_variables.append( 'ASAN_OPTIONS', glib_exec_asan_option_ignore_preload, separator: ',') diff --git a/meson.build b/meson.build index 527727a39..f465b7e64 100644 --- a/meson.build +++ b/meson.build @@ -2673,9 +2673,11 @@ glib_exec_preloaded_libs = [] glib_exec_preloaded_env = {} if host_system in ['ios', 'darwin'] + glib_exec_var_library_path = 'DYLD_LIBRARY_PATH' glib_exec_var_preload = 'DYLD_INSERT_LIBRARIES' glib_exec_var_preload_separator = ':' else + glib_exec_var_library_path = 'LD_LIBRARY_PATH' glib_exec_var_preload = 'LD_PRELOAD' glib_exec_var_preload_separator = ' ' endif