summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-05-04 03:23:36 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-05-04 03:23:36 +0000
commit18efed7adc79c1970f307bb5b015d199012ba872 (patch)
treeccd3dd94f2e698bc65dc7d17a189a05097503f3b /cmake
parente3ee49fb2728dcb9702b5be0c3c80f472ffccefc (diff)
downloadllvm-18efed7adc79c1970f307bb5b015d199012ba872.tar.gz
llvm-18efed7adc79c1970f307bb5b015d199012ba872.tar.bz2
llvm-18efed7adc79c1970f307bb5b015d199012ba872.tar.xz
Pass -fcolor-diagnostics when it is supported. This makes a difference when
using cmake+ninja, since ninja buffers the compiler output. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156150 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/HandleLLVMOptions.cmake4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake
index d10e59a097..da31cc4c8d 100644
--- a/cmake/modules/HandleLLVMOptions.cmake
+++ b/cmake/modules/HandleLLVMOptions.cmake
@@ -190,6 +190,10 @@ elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE )
if( SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG )
add_llvm_definitions( -Wcovered-switch-default )
endif()
+ check_cxx_compiler_flag("-Werror -fcolor-diagnostics" SUPPORTS_FCOLOR_DIAGNOSTICS_FLAG)
+ if( SUPPORTS_FCOLOR_DIAGNOSTICS_FLAG )
+ add_llvm_definitions( -fcolor-diagnostics )
+ endif()
endif (LLVM_ENABLE_WARNINGS)
if (LLVM_ENABLE_WERROR)
add_llvm_definitions( -Werror )