From 1abcf64283db1670e17dcb6bcc5fdaf6d92317ff Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 4 May 2012 03:23:36 +0000 Subject: [PATCH] Pass -fcolor-diagnostics when it is supported. This makes a difference when using cmake+ninja, since ninja buffers the compiler output. llvm-svn: 156150 --- llvm/cmake/modules/HandleLLVMOptions.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake index d10e59a09729..da31cc4c8dd0 100644 --- a/llvm/cmake/modules/HandleLLVMOptions.cmake +++ b/llvm/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 )