From 21897a10ca0295f65f158ed3cbac396bc5adbb54 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Wed, 28 Oct 2020 22:23:16 +0100 Subject: gnome: Handle libraries that are not in the current build dir The generate_gir() function previously assumed all library inputs were in the current build dir. This would fail if they weren't. --- mesonbuild/modules/gnome.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'mesonbuild/modules/gnome.py') diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index 2d32328..9fd31c7 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -554,15 +554,16 @@ class GnomeModule(ExtensionModule): else: # Because of https://gitlab.gnome.org/GNOME/gobject-introspection/merge_requests/72 # we can't use the full path until this is merged. + libpath = os.path.join(girtarget.get_subdir(), girtarget.get_filename()) if isinstance(girtarget, build.SharedLibrary): + # need to put our output directory first as we need to use the + # generated libraries instead of any possibly installed system/prefix + # ones. + ret += ["-L@BUILD_ROOT@/{}".format(os.path.dirname(libpath))] libname = girtarget.get_basename() else: - libname = os.path.join("@PRIVATE_OUTDIR_ABS_%s@" % girtarget.get_id(), girtarget.get_filename()) + libname = os.path.join("@BUILD_ROOT@/{}".format(libpath)) ret += ['--library', libname] - # need to put our output directory first as we need to use the - # generated libraries instead of any possibly installed system/prefix - # ones. - ret += ["-L@PRIVATE_OUTDIR_ABS_%s@" % girtarget.get_id()] # Needed for the following binutils bug: # https://github.com/mesonbuild/meson/issues/1911 # However, g-ir-scanner does not understand -Wl,-rpath -- cgit v1.1