<div dir="ltr"><div style>LGTM!</div><div style><br></div><div style>I'd been meaning to toss that into CMAKE_CXX_FLAGS locally, but I never actually got around to it.  Might as well do it globally so everyone benefits.</div>
<div style><br></div><div style><div>--- a/cmake/modules/HandleLLVMOptions.cmake</div><div>+++ b/cmake/modules/HandleLLVMOptions.cmake</div><div>@@ -266,3 +266,10 @@ endif()</div><div> add_llvm_definitions( -D__STDC_CONSTANT_MACROS )</div>
<div> add_llvm_definitions( -D__STDC_FORMAT_MACROS )</div><div> add_llvm_definitions( -D__STDC_LIMIT_MACROS )</div></div><div>+# clang doesn't print colored diagnostics when invoked from Ninja<br></div><div>+if(UNIX)</div>
<div>+  if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_GENERATOR STREQUAL "Ninja")</div><div><br></div><div style>if (UNIX AND ...) ?  Looks like it needs wrapping too.</div><div><br></div><div>+    append("-fcolor-diagnostics" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)</div>
<div>+  endif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_GENERATOR STREQUAL "Ninja")</div><div><br></div><div style>Most endif's in this file don't duplicate the condition, so I'd drop it.</div>
<div><br></div><div>+endif(UNIX)</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 28, 2013 at 5:17 AM, Arnaud A. de Grandmaison <span dir="ltr"><<a href="mailto:arnaud.adegm@gmail.com" target="_blank">arnaud.adegm@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">When invoked from Ninja, clang does not detect that it can use colors : see<br>
<a href="https://github.com/martine/ninja/issues/174" target="_blank">https://github.com/martine/ninja/issues/174</a><br>
<br>
This patch forces colored diagnostics when building LLVM with cmake + ninja +<br>
clang on UNIX (in CMake parlance) platforms only as I have not been able to<br>
test it on Windows.<br>
<br>
I am wondering though if it could not break interactive tools relying on the<br>
compilation database, like Emacs or Vim, if they are not able to parse the<br>
color sequences. This does not seem to break clang_complete,and most tools are<br>
probably filtering the compilation command line anyway.<br>
<br>
Thoughts ? OK to apply ?<br>
<br>
Cheers,<br>
<span class="HOEnZb"><font color="#888888">--<br>
Arnaud A. de Grandmaison</font></span><br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>