From 14aaaa325bf02e0078c197e84e90c40c6548efc3 Mon Sep 17 00:00:00 2001 From: Norihiro Kamae Date: Mon, 26 Aug 2024 16:25:09 +0900 Subject: [PATCH] cmake/linux: Move color diagnostics setting to preset for ubuntu-ci This also removes color diagnostics setting for cmake < 3.24. --- CMakePresets.json | 3 ++- cmake/linux/compilerconfig.cmake | 8 +------- 2 files changed, 3 insertions(+), 8 deletions(-) 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)