Introduce `CMAKE_COLOR_DIAGNOSTICS` and `CMAKE_COMPILER_COLOR_DIAGNOSTICS` variables
CMAKE_COMPILER_COLOR_DIAGNOSTICS. This variable controls whether CMake should enable colored compiler diagnostics via compiler flags. It has 3 states:
ONwill force colored diagnostics (
OFFwill disable colored diagnostics (
-fno-color-diagnostics). If the variable is not defined - then CMake will not pass anything and default behavior will be used. By default, this variable is
Ninjagenerators and not defined for other cases.
CMAKE_COLOR_DIAGNOSTICS. This variable controls all colored diagnostics in CMake. When
ONit will force
OFFit does nothing. By default, it's
This MR consists of 2 commits. First introduce
CMAKE_COMPILER_COLOR_DIAGNOSTICS and second introduces
CMAKE_COLOR_DIAGNOSTICS. These are dependent commits, so I was unable to create separate MRs for each of them. However, I consider them as solving separate issues. Variable
CMAKE_COMPILER_COLOR_DIAGNOSTICS solve actual issue at hand - no colored diagnostics for CMake. I consider this to be a more critical issue. While the second variable
CMAKE_COLOR_DIAGNOSTICS is more of a quality of life variable needed for easier configuration for users.
Fixes: #15502 (closed)