<p dir="ltr">This is fine, but would you mind moving it to the cmake and autoconf checks respectively? Probably near the warning checks where we already check for compiler.</p>
<br><div class="gmail_quote"><div dir="ltr">On Fri, Aug 14, 2015, 10:41 AM Chris Bieneman <<a href="mailto:beanz@apple.com">beanz@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">beanz updated this revision to Diff 32163.<br>
beanz added a comment.<br>
<br>
Should have been calling $(CC) not cc in the makefile. Oops.<br>
<br>
<br>
<a href="http://reviews.llvm.org/D12036" rel="noreferrer" target="_blank">http://reviews.llvm.org/D12036</a><br>
<br>
Files:<br>
  CMakeLists.txt<br>
  Makefile<br>
<br>
Index: Makefile<br>
===================================================================<br>
--- Makefile<br>
+++ Makefile<br>
@@ -67,8 +67,11 @@<br>
 #   <a href="http://gcc.gnu.org/PR41874" rel="noreferrer" target="_blank">http://gcc.gnu.org/PR41874</a><br>
 #   <a href="http://gcc.gnu.org/PR41838" rel="noreferrer" target="_blank">http://gcc.gnu.org/PR41838</a><br>
 #<br>
-# We can revisit this when LLVM/Clang support it.<br>
+# We don't need to do this if the host compiler is clang.<br>
+ifeq ($(shell $(CC) -v 2>&1 | grep clang), "")<br>
 CXX.Flags += -fno-strict-aliasing<br>
+endif<br>
+<br>
<br>
 # Set up Clang's tblgen.<br>
 ifndef CLANG_TBLGEN<br>
Index: CMakeLists.txt<br>
===================================================================<br>
--- CMakeLists.txt<br>
+++ CMakeLists.txt<br>
@@ -253,7 +253,10 @@<br>
<br>
 # Add appropriate flags for GCC<br>
 if (LLVM_COMPILER_IS_GCC_COMPATIBLE)<br>
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-common -Woverloaded-virtual -fno-strict-aliasing")<br>
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-common -Woverloaded-virtual")<br>
+  if (NOT LLVM_COMPILER_IS_CLANG)<br>
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing")<br>
+  endif ()<br>
<br>
   # Enable -pedantic for Clang even if it's not enabled for LLVM.<br>
   if (NOT LLVM_ENABLE_PEDANTIC)<br>
<br>
<br>
</blockquote></div>