summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorArnaud A. de Grandmaison <arnaud.adegm@gmail.com>2013-05-29 20:41:35 +0000
committerArnaud A. de Grandmaison <arnaud.adegm@gmail.com>2013-05-29 20:41:35 +0000
commit745825f582c866ae8bf605183d00772510d252c4 (patch)
treef4e0c8ef2e144ca13643a88cd54ca199367839b9 /cmake
parentf567a6d39b05ebdcdb42b4183f6cfdada75ec189 (diff)
downloadllvm-745825f582c866ae8bf605183d00772510d252c4.tar.gz
llvm-745825f582c866ae8bf605183d00772510d252c4.tar.bz2
llvm-745825f582c866ae8bf605183d00772510d252c4.tar.xz
Add colored diagnostics when building LLVM with cmake + ninja + clang
When invoked from Ninja, clang does not detect that it can use colors : see https://github.com/martine/ninja/issues/174 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182878 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/HandleLLVMOptions.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake
index f8a017dcae..2939fa2afa 100644
--- a/cmake/modules/HandleLLVMOptions.cmake
+++ b/cmake/modules/HandleLLVMOptions.cmake
@@ -266,3 +266,10 @@ endif()
add_llvm_definitions( -D__STDC_CONSTANT_MACROS )
add_llvm_definitions( -D__STDC_FORMAT_MACROS )
add_llvm_definitions( -D__STDC_LIMIT_MACROS )
+
+# clang doesn't print colored diagnostics when invoked from Ninja
+if (UNIX AND
+ CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
+ CMAKE_GENERATOR STREQUAL "Ninja")
+ append("-fcolor-diagnostics" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+endif()