summaryrefslogtreecommitdiffstats
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
commit916f3ccacf09ee4d9032bbdb7a52e40b268dc806 (patch)
treef93477dfc6afbffbaa8270396220a626fa14081b
parentf60e0e44caf9f9c3cdc556e51a34e29bc11647af (diff)
downloadbcm5719-llvm-916f3ccacf09ee4d9032bbdb7a52e40b268dc806.tar.gz
bcm5719-llvm-916f3ccacf09ee4d9032bbdb7a52e40b268dc806.zip
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 llvm-svn: 182878
-rw-r--r--llvm/cmake/modules/HandleLLVMOptions.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index f8a017dcaef..2939fa2afa2 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/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()
OpenPOWER on IntegriCloud