From 72e131cb50cebe2535c566d1e5bff853ed74de70 Mon Sep 17 00:00:00 2001 From: Username404 Date: Sat, 8 Jan 2022 13:14:33 +0100 Subject: [PATCH] Add a minimal MSVC version Signed-off-by: Username404 --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 63bdbd2..c5eb4f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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()