From b5b235c75fcbf39fb3310e6bc9c711f1aee410ce Mon Sep 17 00:00:00 2001 From: Felix Weilbach Date: Fri, 20 Aug 2021 11:22:00 +0200 Subject: [PATCH] Color compile ouput when using Ninja build file generator Signed-off-by: Felix Weilbach --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 315eb8e82..8e2a63e58 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,6 +44,12 @@ endif() include(Warnings) +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + add_compile_options(-fdiagnostics-color=always) +elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + add_compile_options(-fcolor-diagnostics) +endif() + include(${CMAKE_SOURCE_DIR}/VERSION.cmake) # For config.h include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -- 2.30.2