diff options
author | Nico Weber <nicolasweber@gmx.de> | 2015-03-09 10:34:08 -0700 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2015-03-09 10:34:08 -0700 |
commit | 7b9cdfcf81443a2190e9ac4f9246ca227559cc60 (patch) | |
tree | a5b4268cb1f8a590d08cf6dec932cf1b949e2817 | |
parent | 64e2cf770172638c2a23268bef3b8efade3598bf (diff) | |
parent | 00a061cde9acee7ceec69880439f6118a0a27fb2 (diff) | |
download | ninja-7b9cdfcf81443a2190e9ac4f9246ca227559cc60.tar.gz |
Merge pull request #927 from nico/colorgcc
Make diagnostics colored with new gccs (4.9+) too.
-rwxr-xr-x | configure.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/configure.py b/configure.py index cb08c17..661662f 100755 --- a/configure.py +++ b/configure.py @@ -318,9 +318,12 @@ else: else: cflags += ['-O2', '-DNDEBUG'] try: - proc = subprocess.Popen([CXX, '--version'], stdout=subprocess.PIPE) - if 'clang' in proc.communicate()[0].decode('utf-8'): - cflags += ['-fcolor-diagnostics'] + proc = subprocess.Popen( + [CXX, '-fdiagnostics-color', '-c', '-x', 'c++', '/dev/null'], + stdout=open(os.devnull, 'wb'), stderr=subprocess.STDOUT) + proc.wait() + if proc.returncode == 0: + cflags += ['-fdiagnostics-color'] except: pass if platform.is_mingw(): |