Commit d7df1f26 authored by Milo Yip's avatar Milo Yip

Add /W4 and /WX for VC

parent 89afda06
......@@ -44,6 +44,20 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-double-promotion")
endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# Force to always compile with /W4
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
endif()
# Force to always compile with /WX
if(CMAKE_CXX_FLAGS MATCHES "/WX-")
string(REGEX REPLACE "/WX-" "/WX" CMAKE_CXX_FLAGS
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
endif()
add_definitions(-D_CRT_SECURE_NO_WARNINGS=1)
endif()
......
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