summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2012-05-07 04:36:45 (GMT)
committerEvan Martin <martine@danga.com>2012-05-07 04:36:45 (GMT)
commitff16370b605c3f668444484eaea2c10a0b62b72f (patch)
tree7fe8dc433c9c034a2ca27f9cd95c1959e47d2ecd
parent0559ce12dbac9fdb70b9fee4807010c7db20ac9c (diff)
parent4544786a0a6372522d90df6b1a6c3a935c615bed (diff)
downloadNinja-ff16370b605c3f668444484eaea2c10a0b62b72f.zip
Ninja-ff16370b605c3f668444484eaea2c10a0b62b72f.tar.gz
Ninja-ff16370b605c3f668444484eaea2c10a0b62b72f.tar.bz2
Merge pull request #297 from nico/colorclang
Produce colored diagnostics when building ninja with clang.
-rwxr-xr-xconfigure.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/configure.py b/configure.py
index adea5d1..a0c58f5 100755
--- a/configure.py
+++ b/configure.py
@@ -78,8 +78,10 @@ n.variable('configure_env',
' '.join([k + '=' + configure_env[k] for k in configure_env]))
n.newline()
+CXX = configure_env.get('CXX', 'g++')
objext = '.o'
if platform == 'windows':
+ CXX = 'cl'
objext = '.obj'
def src(filename):
@@ -98,11 +100,10 @@ def binary(name):
return name
n.variable('builddir', 'build')
+n.variable('cxx', CXX)
if platform == 'windows':
- n.variable('cxx', 'cl')
n.variable('ar', 'link')
else:
- n.variable('cxx', configure_env.get('CXX', 'g++'))
n.variable('ar', configure_env.get('AR', 'ar'))
if platform == 'windows':
@@ -126,6 +127,8 @@ else:
cflags += ['-D_GLIBCXX_DEBUG', '-D_GLIBCXX_DEBUG_PEDANTIC']
else:
cflags += ['-O2', '-DNDEBUG']
+ if 'clang' in os.path.basename(CXX):
+ cflags += ['-fcolor-diagnostics']
ldflags = ['-L$builddir']
libs = []