summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Gonzalez <rymg19@gmail.com>2015-03-09 00:09:01 (GMT)
committerRyan Gonzalez <rymg19@gmail.com>2015-03-09 00:09:01 (GMT)
commit160af7d034b0016409b2602cd766dd0a7a590a8e (patch)
tree74b591489b1ecd45a58cfb50ef45c69fa563749b
parentabc612d4eb6625af6a4b0702f16ab24e5b5a315d (diff)
downloadNinja-160af7d034b0016409b2602cd766dd0a7a590a8e.zip
Ninja-160af7d034b0016409b2602cd766dd0a7a590a8e.tar.gz
Ninja-160af7d034b0016409b2602cd766dd0a7a590a8e.tar.bz2
Test for Clang by checking --version
-rwxr-xr-xconfigure.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/configure.py b/configure.py
index fe71372..cb08c17 100755
--- a/configure.py
+++ b/configure.py
@@ -317,8 +317,12 @@ else:
cflags.remove('-fno-rtti') # Needed for above pedanticness.
else:
cflags += ['-O2', '-DNDEBUG']
- if 'clang' in os.path.basename(CXX):
- cflags += ['-fcolor-diagnostics']
+ try:
+ proc = subprocess.Popen([CXX, '--version'], stdout=subprocess.PIPE)
+ if 'clang' in proc.communicate()[0].decode('utf-8'):
+ cflags += ['-fcolor-diagnostics']
+ except:
+ pass
if platform.is_mingw():
cflags += ['-D_WIN32_WINNT=0x0501']
ldflags = ['-L$builddir']