From 76cd30620470345732a07d18833169170de66220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Louren=C3=A7o?= Date: Sun, 19 Feb 2017 16:36:49 +0000 Subject: [PATCH 1/4] Add b_colorout option for Clang compilers. --- mesonbuild/compilers.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py index 535111106..92b44d270 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] From 15ecd6aeb2f6189c728030d49c99ff34c4db7674 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Louren=C3=A7o?= Date: Mon, 20 Feb 2017 09:17:04 +0000 Subject: [PATCH 2/4] Update minimum Clang version for colored output --- mesonbuild/compilers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py index 92b44d270..18a94a138 100644 --- a/mesonbuild/compilers.py +++ b/mesonbuild/compilers.py @@ -2444,7 +2444,7 @@ class ClangCompiler: return ['-fPIC'] def get_colorout_args(self, colortype): - if mesonlib.version_compare(self.version, '>=3.3'): + if mesonlib.version_compare(self.version, '>=3.1'): return clang_color_args[colortype][:] return [] From ec1c163da0337dfd5c937d236ad051a9113cce3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Louren=C3=A7o?= Date: Mon, 20 Feb 2017 17:48:04 +0000 Subject: [PATCH 3/4] Add auto option to b_colored when using Clang. Remove Clang version check when enabling colored output. --- mesonbuild/compilers.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py index 18a94a138..30f260836 100644 --- a/mesonbuild/compilers.py +++ b/mesonbuild/compilers.py @@ -188,7 +188,8 @@ gnu_color_args = {'auto': ['-fdiagnostics-color=auto'], 'never': ['-fdiagnostics-color=never'], } -clang_color_args = {'always': ['-Xclang', '-fcolor-diagnostics'], +clang_color_args = {'auto': ['-Xclang', '-fcolor-diagnostics'], + 'always': ['-Xclang', '-fcolor-diagnostics'], 'never': ['-Xclang', '-fno-color-diagnostics'], } @@ -2444,9 +2445,7 @@ class ClangCompiler: return ['-fPIC'] def get_colorout_args(self, colortype): - if mesonlib.version_compare(self.version, '>=3.1'): - return clang_color_args[colortype][:] - return [] + return clang_color_args[colortype][:] def get_buildtype_args(self, buildtype): return gnulike_buildtype_args[buildtype] From 73e36c5b2b085828263067883ec8f47d6580b2a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Louren=C3=A7o?= Date: Mon, 20 Feb 2017 19:11:30 +0000 Subject: [PATCH 4/4] Add myself as an author. --- authors.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/authors.txt b/authors.txt index 2f36256cc..fffbfc150 100644 --- a/authors.txt +++ b/authors.txt @@ -63,3 +63,4 @@ Kseniia Vasilchuk Philipp Geier Mike Sinkovsky Dima Krasner +Rodrigo Lourenço