Skip to content

Commit

Permalink
Add colored diagnostics when building LLVM with cmake + ninja + clang
Browse files Browse the repository at this point in the history
When invoked from Ninja, clang does not detect that it can use colors : see ninja-build/ninja#174

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182878 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Arnaud-de-Grandmaison committed May 29, 2013
1 parent f567a6d commit 745825f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmake/modules/HandleLLVMOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 745825f

Please sign in to comment.