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.
This commit is contained in:
Ting-Wei Lan 2017-12-18 18:41:49 +08:00
parent 08113da388
commit ab2f68ec9c
1 changed files with 6 additions and 0 deletions

View File

@ -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}