[PATCH] [CMake] Don't pass in MSVC warning flags as definitions

Greg Bedwell greg_bedwell at sn.scee.net
Mon Mar 9 17:14:07 PDT 2015


Thanks for looking at my patch!


================
Comment at: cmake/modules/HandleLLVMOptions.cmake:297
@@ +296,3 @@
+  foreach(flag ${msvc_warning_flags})
+    append("${flag}" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+  endforeach(flag)
----------------
rnk wrote:
> Does this actually work in the VS generator? I think you need to tweak CMAKE_C_DEBUG_FLAGS, CMAKE_C_RELEASE_FLAGS, etc. You can search around for instances of for loops over CMAKE_BUILD_TYPES to see how this is done.
With the VS2013 generator 'Visual Studio 12 Win64' and CMake 3.1.3 I can see these flags in the solution properties for all build configurations so it seems to work on my setup.  I'll test on CMake 2.8.12.2 on the plain 'Visual Studio 12' generator too just to be sure.  If these tests show it to work, does this implementation seem reasonable?  Are there other reasons why it is preferable for them to appear in the individual build config flag lists?

http://reviews.llvm.org/D8188

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list