gobject-introspection r488 - in trunk: . tools
- From: walters svn gnome org
- To: svn-commits-list gnome org
- Subject: gobject-introspection r488 - in trunk: . tools
- Date: Mon, 25 Aug 2008 00:32:30 +0000 (UTC)
Author: walters
Date: Mon Aug 25 00:32:30 2008
New Revision: 488
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=488&view=rev
Log:
2008-08-24 Colin Walters <walters verbum org>
* tools/g-ir-scanner: Filter out unknown options from
pkg-config files.
Modified:
trunk/ChangeLog
trunk/tools/g-ir-scanner
Modified: trunk/tools/g-ir-scanner
==============================================================================
--- trunk/tools/g-ir-scanner (original)
+++ trunk/tools/g-ir-scanner Mon Aug 25 00:32:30 2008
@@ -137,14 +137,26 @@
for package in options.packages:
output = subprocess.Popen(['pkg-config', '--cflags', package],
stdout=subprocess.PIPE).communicate()[0]
- pkg_options, unused = parser.parse_args(output.split())
+ # Some pkg-config files on Windows have options we don't understand,
+ # so we explicitly filter to only the ones we need.
+ options_whitelist = ['-I', '-D', '-U', '-l', '-L']
+ def filter_option(opt):
+ for optstart in options_whitelist:
+ if opt.startswith(optstart):
+ return True
+ return False
+ output = output.split()
+ filtered_output = filter(filter_option, output)
+ pkg_options, unused = parser.parse_args(filtered_output)
options.cpp_includes.extend(pkg_options.cpp_includes)
options.cpp_defines.extend(pkg_options.cpp_defines)
options.cpp_undefines.extend(pkg_options.cpp_undefines)
output = subprocess.Popen(['pkg-config', '--libs-only-L', package],
stdout=subprocess.PIPE).communicate()[0]
- pkg_options, unused = parser.parse_args(output.split())
+ output = output.split()
+ filtered_output = filter(filter_option, output)
+ pkg_options, unused = parser.parse_args(filtered_output)
options.library_paths.extend(pkg_options.library_paths)
filenames = []
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]