Browse Source

Color compile ouput when using Ninja build file generator

Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
Felix Weilbach 4 years ago
parent
commit
b5b235c75f
1 changed files with 6 additions and 0 deletions
  1. 6 0
      CMakeLists.txt

+ 6 - 0
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})