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.
parent fa8b2d61
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment