CMake: move MSVC warnings to central location

This commit is contained in:
Campbell Barton
2017-09-28 12:59:28 +10:00
parent 1f18523edf
commit 0ae1a1ed48
2 changed files with 3 additions and 3 deletions

View File

@@ -1472,6 +1472,7 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
"/wd4800" # forcing value to bool 'true' or 'false'
# errors:
"/we4013" # 'function' undefined; assuming extern returning int
"/we4133" # incompatible pointer types
"/we4431" # missing type specifier - int assumed
)

View File

@@ -97,9 +97,8 @@ add_definitions(-D_WIN32_WINNT=0x600)
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
include(InstallRequiredSystemLibraries)
#4133 treat incompatible pointer types as error
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /nologo /J /Gd /MP /EHsc /we4133")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /nologo /J /Gd /MP /we4133")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /nologo /J /Gd /MP /EHsc")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /nologo /J /Gd /MP")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")