From 756a12d0d1c4259226a4ca8e77b3c6fcffe09cd0 Mon Sep 17 00:00:00 2001 From: Greg Bedwell Date: Wed, 11 Mar 2015 14:57:48 +0000 Subject: [PATCH] Revert "[CMake] Don't pass in MSVC warning flags as definitions" reverting while I investigate why it broke the sanitizer-windows build. This reverts commit r231924. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231925 91177308-0d34-0410-b5e6-96231b3b80d8 --- cmake/modules/HandleLLVMOptions.cmake | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake index 30d0cd774f4..45b4d3278cb 100644 --- a/cmake/modules/HandleLLVMOptions.cmake +++ b/cmake/modules/HandleLLVMOptions.cmake @@ -243,7 +243,7 @@ if( MSVC ) if( MSVC11 ) add_llvm_definitions(-D_VARIADIC_MAX=10) endif() - + # Add definitions that make MSVC much less annoying. add_llvm_definitions( # For some reason MS wants to deprecate a bunch of standard functions... @@ -253,9 +253,7 @@ if( MSVC ) -D_CRT_NONSTDC_NO_WARNINGS -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS - ) - set(msvc_warning_flags # Disabled warnings. -wd4146 # Suppress 'unary minus operator applied to unsigned type, result still unsigned' -wd4180 # Suppress 'qualifier applied to function type has no meaning; ignored' @@ -274,7 +272,7 @@ if( MSVC ) -wd4624 # Suppress ''derived class' : destructor could not be generated because a base class destructor is inaccessible' -wd4722 # Suppress 'function' : destructor never returns, potential memory leak -wd4800 # Suppress ''type' : forcing value to bool 'true' or 'false' (performance warning)' - + # Promoted warnings. -w14062 # Promote 'enumerator in switch of enum is not handled' to level 1 warning. @@ -284,19 +282,14 @@ if( MSVC ) # Enable warnings if (LLVM_ENABLE_WARNINGS) - append("/W4" msvc_warning_flags) + add_llvm_definitions( /W4 ) if (LLVM_ENABLE_PEDANTIC) # No MSVC equivalent available endif (LLVM_ENABLE_PEDANTIC) endif (LLVM_ENABLE_WARNINGS) if (LLVM_ENABLE_WERROR) - append("/WX" msvc_warning_flags) + add_llvm_definitions( /WX ) endif (LLVM_ENABLE_WERROR) - - foreach(flag ${msvc_warning_flags}) - append("${flag}" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) - endforeach(flag) - elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE ) if (LLVM_ENABLE_WARNINGS) append("-Wall -W -Wno-unused-parameter -Wwrite-strings" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) -- 2.34.1