diff options
author | Johan Dahlin <johan@gnome.org> | 2010-09-02 12:21:38 -0300 |
---|---|---|
committer | Johan Dahlin <johan@gnome.org> | 2010-09-02 12:37:55 -0300 |
commit | 95883d357b9205094ea285ffb64b508e6317a823 (patch) | |
tree | 047c089f3bdac8d279d4aed206b6ce90da71f786 | |
parent | ce3834d1ae059ebf149d282a8298375158f89141 (diff) | |
download | gobject-introspection-95883d357b9205094ea285ffb64b508e6317a823.tar.gz |
[scannermain] Create a new option parser
Create a new option parser when parsing pkg-config output
-rw-r--r-- | giscanner/scannermain.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py index bf2af396..d2bd8766 100644 --- a/giscanner/scannermain.py +++ b/giscanner/scannermain.py @@ -183,7 +183,7 @@ def process_options(output, allowed_flags): yield option break -def process_packages(parser, options, packages): +def process_packages(options, packages): args = ['pkg-config', '--cflags'] args.extend(packages) output = subprocess.Popen(args, @@ -196,6 +196,7 @@ def process_packages(parser, options, packages): # so we explicitly filter to only the ones we need. options_whitelist = ['-I', '-D', '-U', '-l', '-L'] filtered_output = list(process_options(output, options_whitelist)) + parser = _get_option_parser() pkg_options, unused = parser.parse_args(filtered_output) options.cpp_includes.extend(pkg_options.cpp_includes) options.cpp_defines.extend(pkg_options.cpp_defines) @@ -283,7 +284,7 @@ def scanner_main(args): packages = set(options.packages) packages.update(transformer.get_pkgconfig_packages()) - exit_code = process_packages(parser, options, packages) + exit_code = process_packages(options, packages) if exit_code: return exit_code |