forked from OSchip/llvm-project
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. llvm-svn: 231925
This commit is contained in:
parent
8b0d3f1ea4
commit
580defbbae
|
@ -253,9 +253,7 @@ if( MSVC )
|
||||||
-D_CRT_NONSTDC_NO_WARNINGS
|
-D_CRT_NONSTDC_NO_WARNINGS
|
||||||
-D_SCL_SECURE_NO_DEPRECATE
|
-D_SCL_SECURE_NO_DEPRECATE
|
||||||
-D_SCL_SECURE_NO_WARNINGS
|
-D_SCL_SECURE_NO_WARNINGS
|
||||||
)
|
|
||||||
|
|
||||||
set(msvc_warning_flags
|
|
||||||
# Disabled warnings.
|
# Disabled warnings.
|
||||||
-wd4146 # Suppress 'unary minus operator applied to unsigned type, result still unsigned'
|
-wd4146 # Suppress 'unary minus operator applied to unsigned type, result still unsigned'
|
||||||
-wd4180 # Suppress 'qualifier applied to function type has no meaning; ignored'
|
-wd4180 # Suppress 'qualifier applied to function type has no meaning; ignored'
|
||||||
|
@ -284,19 +282,14 @@ if( MSVC )
|
||||||
|
|
||||||
# Enable warnings
|
# Enable warnings
|
||||||
if (LLVM_ENABLE_WARNINGS)
|
if (LLVM_ENABLE_WARNINGS)
|
||||||
append("/W4" msvc_warning_flags)
|
add_llvm_definitions( /W4 )
|
||||||
if (LLVM_ENABLE_PEDANTIC)
|
if (LLVM_ENABLE_PEDANTIC)
|
||||||
# No MSVC equivalent available
|
# No MSVC equivalent available
|
||||||
endif (LLVM_ENABLE_PEDANTIC)
|
endif (LLVM_ENABLE_PEDANTIC)
|
||||||
endif (LLVM_ENABLE_WARNINGS)
|
endif (LLVM_ENABLE_WARNINGS)
|
||||||
if (LLVM_ENABLE_WERROR)
|
if (LLVM_ENABLE_WERROR)
|
||||||
append("/WX" msvc_warning_flags)
|
add_llvm_definitions( /WX )
|
||||||
endif (LLVM_ENABLE_WERROR)
|
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 )
|
elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE )
|
||||||
if (LLVM_ENABLE_WARNINGS)
|
if (LLVM_ENABLE_WARNINGS)
|
||||||
append("-Wall -W -Wno-unused-parameter -Wwrite-strings" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
append("-Wall -W -Wno-unused-parameter -Wwrite-strings" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
||||||
|
|
Loading…
Reference in New Issue