aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2019-07-04 15:24:33 +0200
committerGitHub <noreply@github.com>2019-07-04 15:24:33 +0200
commit0c639e8777c2e244b8e91c445edb4d75e1bf8909 (patch)
tree49734db5618f4fa34f8715bc95345423b2e1f281
parent05a17e419a445ddd9c4920c7b2ab02f95c2f2f9e (diff)
downloadrneovim-0c639e8777c2e244b8e91c445edb4d75e1bf8909.tar.gz
rneovim-0c639e8777c2e244b8e91c445edb4d75e1bf8909.tar.bz2
rneovim-0c639e8777c2e244b8e91c445edb4d75e1bf8909.zip
build: use -fdiagnostics-color=always with Ninja (#10419)
"auto" does not work, since Ninja does not appear as a TTY to gcc/clang, but handles stripping escape codes itself when output is not to a TTY. Ref: https://github.com/ninja-build/ninja/blob/ca041d88f4d6/src/build.cc#L158-L169
-rw-r--r--CMakeLists.txt6
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")