[gobject-introspection] giscanner: small cpp_args cleanup



commit 44ff0d355021f527a518d320f403aa0717fd0bc8
Author: Dieter Verfaillie <dieterv optionexplicit be>
Date:   Fri Apr 12 07:31:55 2013 +0200

    giscanner: small cpp_args cleanup
    
    No need for two variables...
    
    https://bugzilla.gnome.org/show_bug.cgi?id=699533

 giscanner/sourcescanner.py |   20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)
---
diff --git a/giscanner/sourcescanner.py b/giscanner/sourcescanner.py
index a1103a1..736ddbd 100644
--- a/giscanner/sourcescanner.py
+++ b/giscanner/sourcescanner.py
@@ -278,19 +278,17 @@ class SourceScanner(object):
 
         defines = ['__GI_SCANNER__']
         undefs = []
-        cpp_exec = os.environ.get('CC', 'cc').split()
-        # The Microsoft compiler/preprocessor (cl) does not accept
-        # source input from stdin (the '-' flag), so we need
-        # some help from gcc from MinGW/Cygwin or so.
-        # Note that the generated dumper program is
-        # still built and linked by Visual C++.
-        if 'cl' in cpp_exec:
-            cpp_args = 'gcc'.split()
-        else:
-            cpp_args = cpp_exec
+        cpp_args = os.environ.get('CC', 'cc').split()  # support CC="ccache gcc"
+        if 'cl' in cpp_args:
+            # The Microsoft compiler/preprocessor (cl) does not accept
+            # source input from stdin (the '-' flag), so we need
+            # some help from gcc from MinGW/Cygwin or so.
+            # Note that the generated dumper program is
+            # still built and linked by Visual C++.
+            cpp_args = ['gcc']
         cpp_args += ['-E', '-C', '-I.', '-']
-
         cpp_args += self._cpp_options
+
         proc = subprocess.Popen(cpp_args,
                                 stdin=subprocess.PIPE,
                                 stdout=subprocess.PIPE)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]