]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Detect unsupported VS at configure time (and not at compile time)
authortbeu <tc@tbeu.de>
Sun, 21 Mar 2021 18:28:04 +0000 (19:28 +0100)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Mon, 22 Mar 2021 09:30:09 +0000 (10:30 +0100)
CMakeLists.txt

index 514d2d4aaba4344b90509043c0e58ff44f9162eb..88a57d89d00f7663370a8e7331004fa6da1783ed 100644 (file)
@@ -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.