Color compile ouput when using Ninja build file generator
authorFelix Weilbach <felix.weilbach@nextcloud.com>
Fri, 20 Aug 2021 09:22:00 +0000 (11:22 +0200)
committerFelix Weilbach (Rebase PR Action) <felix.weilbach@t-online.de>
Fri, 20 Aug 2021 13:20:55 +0000 (13:20 +0000)
Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
CMakeLists.txt

index 315eb8e8280bb43725ad8a4295eaa6fcf443640a..8e2a63e5814c986699c2f18b11593a91cbb1fffe 100644 (file)
@@ -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})