forked from bartvdbraak/blender
Cmake cleanup
Move compiler warnings for msvc to common compilerwarnings.
This commit is contained in:
parent
67766f7715
commit
5cce2e1cfe
@ -1111,30 +1111,6 @@ elseif(WIN32)
|
||||
set(CMAKE_C_FLAGS_MINSIZEREL "/O1 /Ob1 /MT /MP" CACHE STRING "MSVC MT flags " FORCE)
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "/O2 /Ob1 /MT /Zi /MP" CACHE STRING "MSVC MT flags " FORCE)
|
||||
|
||||
# most msvc warnings are C & C++
|
||||
set(_WARNINGS
|
||||
# warning level:
|
||||
"/W3"
|
||||
"/w34062" # switch statement contains 'default' but no 'case' labels
|
||||
# disable:
|
||||
"/wd4018" # signed/unsigned mismatch
|
||||
"/wd4065" # switch statement contains 'default' but no 'case' labels
|
||||
"/wd4127" # conditional expression is constant
|
||||
"/wd4181" # qualifier applied to reference type; ignored
|
||||
"/wd4200" # zero-sized array in struct/union
|
||||
"/wd4244" # conversion from 'type1' to 'type2', possible loss of data
|
||||
"/wd4267" # conversion from 'size_t' to 'type', possible loss of data
|
||||
"/wd4305" # truncation from 'type1' to 'type2'
|
||||
"/wd4800" # forcing value to bool 'true' or 'false'
|
||||
# errors:
|
||||
"/we4013" # 'function' undefined; assuming extern returning int
|
||||
"/we4431" # missing type specifier - int assumed
|
||||
)
|
||||
|
||||
string(REPLACE ";" " " _WARNINGS "${_WARNINGS}")
|
||||
set(C_WARNINGS "${_WARNINGS}")
|
||||
set(CXX_WARNINGS "${_WARNINGS}")
|
||||
unset(_WARNINGS)
|
||||
|
||||
set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib")
|
||||
|
||||
@ -2510,7 +2486,31 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
|
||||
# disable numbered, false positives
|
||||
set(C_WARNINGS "${C_WARNINGS} -wd188,186,144,913,556")
|
||||
set(CXX_WARNINGS "${CXX_WARNINGS} -wd188,186,144,913,556")
|
||||
elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
|
||||
# most msvc warnings are C & C++
|
||||
set(_WARNINGS
|
||||
# warning level:
|
||||
"/W3"
|
||||
"/w34062" # switch statement contains 'default' but no 'case' labels
|
||||
# disable:
|
||||
"/wd4018" # signed/unsigned mismatch
|
||||
"/wd4065" # switch statement contains 'default' but no 'case' labels
|
||||
"/wd4127" # conditional expression is constant
|
||||
"/wd4181" # qualifier applied to reference type; ignored
|
||||
"/wd4200" # zero-sized array in struct/union
|
||||
"/wd4244" # conversion from 'type1' to 'type2', possible loss of data
|
||||
"/wd4267" # conversion from 'size_t' to 'type', possible loss of data
|
||||
"/wd4305" # truncation from 'type1' to 'type2'
|
||||
"/wd4800" # forcing value to bool 'true' or 'false'
|
||||
# errors:
|
||||
"/we4013" # 'function' undefined; assuming extern returning int
|
||||
"/we4431" # missing type specifier - int assumed
|
||||
)
|
||||
|
||||
string(REPLACE ";" " " _WARNINGS "${_WARNINGS}")
|
||||
set(C_WARNINGS "${_WARNINGS}")
|
||||
set(CXX_WARNINGS "${_WARNINGS}")
|
||||
unset(_WARNINGS)
|
||||
endif()
|
||||
|
||||
# ensure python header is found since detection can fail, this could happen
|
||||
|
Loading…
Reference in New Issue
Block a user