diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-11-28 06:05:53 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-03-10 19:05:19 +0530 |
commit | 17323d2b966146ad19af6285e4eea4cd76bd2c7e (patch) | |
tree | dd321e271c44f5f2bdbf11f696122cf5a066b85c /giscanner/scannermain.py | |
parent | aa3d0921c1b9bc6eb9f9d0cf82620a31e05037cd (diff) | |
download | gobject-introspection-17323d2b966146ad19af6285e4eea4cd76bd2c7e.tar.gz |
giscanner: Fix options in the preprocessor group
The way we were parsing cflags was causing cpp_includes, cpp_defines,
cpp_undefines to always be empty because we would consume all arguments
with --cflags-begin's callback.
Now, we make a copy of the 'remaining arguments' and parse those to
populate the cflags independent of cpp_* flags that are used for
building the scanner executable.
This fixes the build when glib and friends aren't available in the
system prefix.
Diffstat (limited to 'giscanner/scannermain.py')
-rwxr-xr-x | giscanner/scannermain.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py index ffcb95cd..1366c04c 100755 --- a/giscanner/scannermain.py +++ b/giscanner/scannermain.py @@ -52,11 +52,14 @@ from . import utils def process_cflags_begin(option, opt, value, parser): cflags = getattr(parser.values, option.dest) - while len(parser.rargs) > 0 and parser.rargs[0] != '--cflags-end': - arg = parser.rargs.pop(0) - if arg == "-I" and parser.rargs and parser.rargs[0] != '--cflags-end': + # Copy instead of consuming else cpp_defines, cpp_includes, etc will be empty + rargs = parser.rargs[:] + while len(rargs) > 0 and rargs[0] != '--cflags-end': + arg = rargs.pop(0) + if arg == "-I" and rargs and rargs[0] != '--cflags-end': # This is a special case where there's a space between -I and the path. - arg += parser.rargs.pop(0) + arg += rargs.pop(0) + incdir = utils.cflag_real_include_path(arg) cflags.append(utils.cflag_real_include_path(arg)) |