2021-12-13 01:47:19 +00:00
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index 1c6952df7..9466a0b7d 100644
2021-12-12 21:35:10 +00:00
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
2021-12-13 01:47:19 +00:00
@@ -923,6 +923,16 @@ class GnomeModule(ExtensionModule):
2021-12-12 21:35:10 +00:00
if fatal_warnings:
scan_command.append('--warn-error')
2021-12-13 01:47:19 +00:00
+ if len(set(girtarget.get_custom_install_dir()[0] for girtarget in girtargets if girtarget.get_custom_install_dir())) > 1:
2021-12-12 21:35:10 +00:00
+ raise MesonException('generate_gir tries to build multiple libraries with different install_dir at once: {}'.format(','.join([str(girtarget) for girtarget in girtargets])))
+
2021-12-13 01:47:19 +00:00
+ if girtargets[0].get_custom_install_dir():
+ fallback_libpath = girtargets[0].get_custom_install_dir()[0]
+ else:
+ fallback_libpath = None
2021-12-12 21:35:10 +00:00
+ if fallback_libpath is not None and isinstance(fallback_libpath, str) and len(fallback_libpath) > 0 and fallback_libpath[0] == "/":
+ scan_command += ['--fallback-library-path=' + fallback_libpath]
+
2021-12-13 01:47:19 +00:00
generated_files = [f for f in libsources if isinstance(f, (GeneratedList, CustomTarget, CustomTargetIndex))]
2021-12-12 21:35:10 +00:00
2021-12-13 01:47:19 +00:00
scan_target = self._make_gir_target(state, girfile, scan_command, generated_files, depends, kwargs)