From 3de0f6d4e94036646321859b9287faba6e99f050 Mon Sep 17 00:00:00 2001 From: kiwixz Date: Mon, 7 Aug 2023 23:53:30 +0200 Subject: clang: use gcc syntax to enable diagnostics color clang has supported gcc syntax since version 3.3.0 from 10 years ago. It's better than its own version because it takes a "when" verb which allows us to explicitely ask for "auto". This is useful when overriding flags that came from elsewhere. Before this patch, meson was just treating b_colorout="auto" as "always". --- mesonbuild/compilers/mixins/clang.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mesonbuild/compilers/mixins/clang.py b/mesonbuild/compilers/mixins/clang.py index 24f24a8df..6a9c79bc7 100644 --- a/mesonbuild/compilers/mixins/clang.py +++ b/mesonbuild/compilers/mixins/clang.py @@ -31,9 +31,9 @@ if T.TYPE_CHECKING: from ...dependencies import Dependency # noqa: F401 clang_color_args: T.Dict[str, T.List[str]] = { - 'auto': ['-fcolor-diagnostics'], - 'always': ['-fcolor-diagnostics'], - 'never': ['-fno-color-diagnostics'], + 'auto': ['-fdiagnostics-color=auto'], + 'always': ['-fdiagnostics-color=always'], + 'never': ['-fdiagnostics-color=never'], } clang_optimization_args: T.Dict[str, T.List[str]] = { -- cgit v1.2.3