Add a minimal MSVC version

Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
Username404 2022-01-08 13:14:33 +01:00
parent 69a5474b1f
commit 72e131cb50
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 4 additions and 0 deletions

View File

@ -32,6 +32,7 @@ set(CMAKE_CXX_FLAGS "-Wall")
set(CMAKE_CXX_FLAGS_RELEASE "-Os")
set(MINIMAL_GNU "11.0")
set(MINIMAL_CLANG "13.0")
set(MINIMAL_MSVC "19.25")
set(IS_GNU (${CMAKE_CXX_COMPILER_ID} STREQUAL GNU))
set(IS_CLANG (${CMAKE_CXX_COMPILER_ID} STREQUAL Clang))
@ -87,6 +88,9 @@ elseif(${IS_CLANG})
endif()
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fstrict-vtable-pointers")
elseif(MSVC)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${MINIMAL_MSVC})
message(FATAL_ERROR "MSVC ${MINIMAL_MSVC} or higher is required")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3 /Zc:__cplusplus /Zc:preprocessor /Zc:throwingNew /Zc:inline")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
endif()