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".
pull/12099/head
kiwixz 1 year ago committed by Eli Schwartz
parent 6671b7359f
commit 3de0f6d4e9
  1. 6
      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]] = {

Loading…
Cancel
Save