aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTing-Wei Lan <lantw@src.gnome.org>2017-12-18 18:41:49 +0800
committerTing-Wei Lan <lantw@src.gnome.org>2018-01-07 01:56:00 +0800
commitab2f68ec9cd3a7b9db3e22c77a1e7d703c26e612 (patch)
treead8147a515cae89934c8c47c508f7ba180c44004
parent08113da388f33fc85151d872f317bc2daacafba1 (diff)
downloadmeson-ab2f68ec9cd3a7b9db3e22c77a1e7d703c26e612.zip
meson-ab2f68ec9cd3a7b9db3e22c77a1e7d703c26e612.tar.gz
meson-ab2f68ec9cd3a7b9db3e22c77a1e7d703c26e612.tar.bz2
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.
-rw-r--r--mesonbuild/modules/gnome.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index 89210a9..3c6bcad 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}