win: Pass /W4 in front of all the -wd flags.
[oota-llvm.git] / cmake / modules / HandleLLVMOptions.cmake
index d583d0ee95c669f57b459fef9ebeaf9b17c9daab..4c5ffe2f7b28e78094fa3da23ba55314be8eab16 100644 (file)
@@ -338,7 +338,10 @@ if( MSVC )
 
   # Enable warnings
   if (LLVM_ENABLE_WARNINGS)
-    append("/W4" msvc_warning_flags)
+    # Put /W4 in front of all the -we flags. cl.exe doesn't care, but for
+    # clang-cl having /W4 after the -we flags will re-enable the warnings
+    # disabled by -we.
+    set(msvc_warning_flags "/W4 ${msvc_warning_flags}")
     # CMake appends /W3 by default, and having /W3 followed by /W4 will result in 
     # cl : Command line warning D9025 : overriding '/W3' with '/W4'.  Since this is
     # a command line warning and not a compiler warning, it cannot be suppressed except