From: tbeu Date: Sun, 21 Mar 2021 18:28:04 +0000 (+0100) Subject: Detect unsupported VS at configure time (and not at compile time) X-Git-Tag: 2.0.2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e0f38cdd368d9a9bca826544bdb7bdea1fc73f3;p=thirdparty%2Fzlib-ng.git Detect unsupported VS at configure time (and not at compile time) --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 514d2d4a..88a57d89 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -160,6 +160,11 @@ if("${CMAKE_C_COMPILER}" MATCHES "icc" OR "${CMAKE_C_COMPILER}" MATCHES "icpc" O message(STATUS "Ignoring WITH_NATIVE_INSTRUCTIONS; not supported on this configuration") endif() elseif(MSVC) + # Minimum supported MSVC version is 1800 = Visual Studio 12.0/2013 + # See also https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html + if(MSVC_VERSION VERSION_LESS 1800) + message(SEND_ERROR "Unsupported Visual Studio compiler version (requires 2013 or later).") + endif() # TODO. ICC can be used through MSVC. I'm not sure if we'd ever see that combination # (who'd use cmake from an IDE...) but checking for ICC before checking for MSVC should # avoid mistakes.