aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodrigo Lourenço <guigo.lourenco@gmail.com>2017-02-19 16:36:49 +0000
committerRodrigo Lourenço <guigo.lourenco@gmail.com>2017-02-19 16:36:49 +0000
commit76cd30620470345732a07d18833169170de66220 (patch)
treec547b80030a711b74514636ecfa85c6d927cfc03
parent5ee92d5bb0c9ad6b6b5bf4b8847d8533dea24c77 (diff)
downloadmeson-76cd30620470345732a07d18833169170de66220.zip
meson-76cd30620470345732a07d18833169170de66220.tar.gz
meson-76cd30620470345732a07d18833169170de66220.tar.bz2
Add b_colorout option for Clang compilers.
-rw-r--r--mesonbuild/compilers.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py
index 5351111..92b44d2 100644
--- a/mesonbuild/compilers.py
+++ b/mesonbuild/compilers.py
@@ -188,6 +188,10 @@ gnu_color_args = {'auto': ['-fdiagnostics-color=auto'],
'never': ['-fdiagnostics-color=never'],
}
+clang_color_args = {'always': ['-Xclang', '-fcolor-diagnostics'],
+ 'never': ['-Xclang', '-fno-color-diagnostics'],
+ }
+
base_options = {'b_pch': coredata.UserBooleanOption('b_pch', 'Use precompiled headers', True),
'b_lto': coredata.UserBooleanOption('b_lto', 'Use link time optimization', False),
'b_sanitize': coredata.UserComboOption('b_sanitize',
@@ -2427,7 +2431,7 @@ class ClangCompiler:
self.id = 'clang'
self.clang_type = clang_type
self.base_options = ['b_pch', 'b_lto', 'b_pgo', 'b_sanitize', 'b_coverage',
- 'b_ndebug', 'b_staticpic']
+ 'b_ndebug', 'b_staticpic', 'b_colorout']
if self.clang_type != CLANG_OSX:
self.base_options.append('b_lundef')
self.base_options.append('b_asneeded')
@@ -2439,6 +2443,11 @@ class ClangCompiler:
return [] # On Window and OS X, pic is always on.
return ['-fPIC']
+ def get_colorout_args(self, colortype):
+ if mesonlib.version_compare(self.version, '>=3.3'):
+ return clang_color_args[colortype][:]
+ return []
+
def get_buildtype_args(self, buildtype):
return gnulike_buildtype_args[buildtype]