mirror of
https://github.com/google/benchmark.git
synced 2024-12-26 12:30:14 +08:00
Remove redundant MSVC++ /W3 triggering warnings
This change looks for CMake's default setting for MSVC++, /W3 (and any other level should that change in the future), and removes it before adding /W4. This stops the build for MSVC++ emitting warnings about /W4 overriding /W3 earlier on the command line.
This commit is contained in:
parent
fa8b2d6171
commit
60b5921735
@ -33,7 +33,8 @@ include(CXXFeatureCheck)
|
||||
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||
# Turn compiler warnings up to 11
|
||||
add_cxx_compiler_flag(-W4)
|
||||
string(REGEX REPLACE "[-/]W[1-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
|
||||
# Link time optimisation
|
||||
|
Loading…
Reference in New Issue
Block a user