OSDN Git Service

cmake: Fix color diags under ninja if the compiler is "AppleClang"
authorJustin Bogner <mail@justinbogner.com>
Wed, 1 Jun 2016 23:29:26 +0000 (23:29 +0000)
committerJustin Bogner <mail@justinbogner.com>
Wed, 1 Jun 2016 23:29:26 +0000 (23:29 +0000)
Apparently cmake differentiates between Clang and AppleClang, and we
fail to color our diagnostics if you have the latter. Fix that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271442 91177308-0d34-0410-b5e6-96231b3b80d8

cmake/modules/HandleLLVMOptions.cmake

index d61f747..75918cf 100644 (file)
@@ -559,7 +559,7 @@ 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_CXX_COMPILER_ID MATCHES "Clang" AND
     CMAKE_GENERATOR STREQUAL "Ninja")
   append("-fcolor-diagnostics" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
 endif()