diff options
author | tbeu <tc@tbeu.de> | 2021-03-21 19:28:04 +0100 |
---|---|---|
committer | Hans Kristian Rosbach <hk-github@circlestorm.org> | 2021-03-22 10:30:09 +0100 |
commit | 8e0f38cdd368d9a9bca826544bdb7bdea1fc73f3 (patch) | |
tree | 5b5a8739ed391ce8069a5b3d77cdae6adeaac0f8 | |
parent | 059572b400b4689058294837b837c4abc9774827 (diff) |
Detect unsupported VS at configure time (and not at compile time)
-rw-r--r-- | CMakeLists.txt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 514d2d4..88a57d8 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. |