diff --git a/CMakePresets.json b/CMakePresets.json index bce62abc9..70fc423cc 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -82,7 +82,8 @@ "inherits": ["ubuntu"], "cacheVariables": { "CMAKE_BUILD_TYPE": "RelWithDebInfo", - "CMAKE_COMPILE_WARNING_AS_ERROR": true + "CMAKE_COMPILE_WARNING_AS_ERROR": true, + "CMAKE_COLOR_DIAGNOSTICS": true } }, { diff --git a/cmake/linux/compilerconfig.cmake b/cmake/linux/compilerconfig.cmake index c88857fde..92ab95735 100644 --- a/cmake/linux/compilerconfig.cmake +++ b/cmake/linux/compilerconfig.cmake @@ -51,17 +51,11 @@ add_compile_options( "$<$:${_obs_clang_cxx_options}>" ) -# Add support for color diagnostics and CMake switch for warnings as errors to CMake < 3.24 +# CMake switch for warnings as errors to CMake < 3.24 if(CMAKE_VERSION VERSION_LESS 3.24.0) - add_compile_options( - $<$:-fcolor-diagnostics> - $<$:-fcolor-diagnostics> - ) if(CMAKE_COMPILE_WARNING_AS_ERROR) add_compile_options(-Werror) endif() -else() - set(CMAKE_COLOR_DIAGNOSTICS ON) endif() if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)