From ab2f68ec9cd3a7b9db3e22c77a1e7d703c26e612 Mon Sep 17 00:00:00 2001 From: Ting-Wei Lan Date: Mon, 18 Dec 2017 18:41:49 +0800 Subject: [PATCH] gnome.generate_gir: Pass *FLAGS set in the environment to g-ir-scanner The reason for this change is the same as the previous commit. Although g-ir-scanner can pick arguments from CFLAGS, CPPFLAGS, LDFLAGS environment variables by itself, it is still better for build systems to put them on the command line instead of relying on users to setup the same environment. Since g-ir-scanner doesn't provide a way to set arbitrary linker flags on the command line, arguments in LDFLAGS that are not started with -L are not passed. --- mesonbuild/modules/gnome.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index 89210a9e8..3c6bcad76 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -565,6 +565,7 @@ class GnomeModule(ExtensionModule): ldflags += list(dep_ldflags) scan_command += ['--cflags-begin'] scan_command += cflags + scan_command += state.environment.coredata.external_args[lang] scan_command += ['--cflags-end'] # need to put our output directory first as we need to use the # generated libraries instead of any possibly installed system/prefix @@ -595,6 +596,11 @@ class GnomeModule(ExtensionModule): d = os.path.join(state.environment.get_build_dir(), d) scan_command.append('-L' + d) scan_command += ['--library', libname] + + for link_arg in state.environment.coredata.external_link_args[lang]: + if link_arg.startswith('-L'): + scan_command.append(link_arg) + scankwargs = {'output': girfile, 'command': scan_command, 'depends': depends}