summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coreconf/check_cc.py9
-rw-r--r--coreconf/config.gypi5
2 files changed, 12 insertions, 2 deletions
diff --git a/coreconf/check_cc.py b/coreconf/check_cc.py
index 6d7e38096..d0736af7d 100644
--- a/coreconf/check_cc.py
+++ b/coreconf/check_cc.py
@@ -10,8 +10,13 @@ def main():
else:
cc = os.environ.get('CC', 'cc')
try:
- cc_is_arg = sys.argv[1] in subprocess.check_output(
- [cc, '--version'], universal_newlines=True)
+ if sys.argv[1] == "cc":
+ cc_output = subprocess.check_output(
+ [cc, '--version'], universal_newlines=True)
+ cc_is_arg = "cc" in cc_output and not ("gcc" in cc_output)
+ else:
+ cc_is_arg = sys.argv[1] in subprocess.check_output(
+ [cc, '--version'], universal_newlines=True)
except OSError:
# We probably just don't have CC/cc.
cc_is_arg = False
diff --git a/coreconf/config.gypi b/coreconf/config.gypi
index 6900f7953..1d731ad85 100644
--- a/coreconf/config.gypi
+++ b/coreconf/config.gypi
@@ -75,6 +75,11 @@
}, {
'cc_is_gcc%': '0',
}],
+ ['"<(GENERATOR)"=="ninja"', {
+ 'cc_is_cc%': '<!("<(python)" <(DEPTH)/coreconf/check_cc.py cc)',
+ }, {
+ 'cc_is_cc%': '0',
+ }],
],
},
# Copy conditionally-set variables out one scope.