Cmake: add compiler option in a more idiomatic way
authorArnaud A. de Grandmaison <arnaud.adegm@gmail.com>
Fri, 14 Jun 2013 19:26:57 +0000 (19:26 +0000)
committerArnaud A. de Grandmaison <arnaud.adegm@gmail.com>
Fri, 14 Jun 2013 19:26:57 +0000 (19:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183995 91177308-0d34-0410-b5e6-96231b3b80d8

cmake/modules/HandleLLVMOptions.cmake

index 2939fa2..b336324 100644 (file)
@@ -268,8 +268,6 @@ 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)
+if (UNIX AND CMAKE_GENERATOR STREQUAL "Ninja")
+  add_flag_if_supported("-fcolor-diagnostics")
 endif()