From 4544786a0a6372522d90df6b1a6c3a935c615bed Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Fri, 4 May 2012 08:44:30 -0700 Subject: Produce colored diagnostics when building ninja with clang. This can be disabled by having -fno-color-diagnostics in CFLAGS, or setting TERM to dumb. --- configure.py | 7 +++++-- 1 file 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 = [] -- cgit v0.12