diff options
-rw-r--r-- | CMakeLists.txt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e9d997ef3e..2900de9b7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -315,7 +315,11 @@ endif() check_c_compiler_flag(-fdiagnostics-color=auto HAS_DIAG_COLOR_FLAG) if(HAS_DIAG_COLOR_FLAG) - add_compile_options(-fdiagnostics-color=auto) + if(CMAKE_GENERATOR MATCHES "Ninja") + add_compile_options(-fdiagnostics-color=always) + else() + add_compile_options(-fdiagnostics-color=auto) + endif() endif() if(CMAKE_C_COMPILER_ID STREQUAL "GNU") |