summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@gnome.org>2015-01-28 21:55:20 -0600
committerMichael Catanzaro <mcatanzaro@gnome.org>2015-02-13 16:39:44 -0600
commitd2dce55c971fc44cc327818b0341eb89f1243db6 (patch)
treea4646c2c131804c7801fcd3b6b2d019bb7a4f2e0
parent1c238c020f790f858a0b2fad6a1305d09198d4bf (diff)
downloadgobject-introspection-d2dce55c971fc44cc327818b0341eb89f1243db6.tar.gz
scanner: don't pass certain debug level flags to cpp
These may cause cpp to output code that still has #defines in them, which the scanner does not expect. https://bugzilla.gnome.org/show_bug.cgi?id=720504
-rw-r--r--giscanner/sourcescanner.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/giscanner/sourcescanner.py b/giscanner/sourcescanner.py
index dab16027..9a814213 100644
--- a/giscanner/sourcescanner.py
+++ b/giscanner/sourcescanner.py
@@ -294,6 +294,14 @@ class SourceScanner(object):
cpp_args += ['-E', '-C', '-I.', '-']
cpp_args += self._cpp_options
+ # We expect the preprocessor to remove macros. If debugging is turned
+ # up high enough that won't happen, so strip these out. Bug #720504
+ for flag in ['-g3', '-ggdb3', '-gstabs3', '-gcoff3', '-gxcoff3', '-gvms3']:
+ try:
+ cpp_args.remove(flag)
+ except ValueError:
+ pass
+
proc = subprocess.Popen(cpp_args,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE)