Detect unsupported VS at configure time (and not at compile time)

This commit is contained in:
tbeu 2020-12-27 19:22:15 +01:00
parent 59d54dab82
commit a86a16e2c5

View file

@ -124,6 +124,14 @@ if(EXPAT_WITH_LIBBSD)
endif()
endif()
if(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 "MSVC_VERSION ${MSVC_VERSION} is not a supported Visual Studio compiler version. Please use Visual Studio 2013 or any later version.")
endif()
endif()
macro(_expat_copy_bool_int source_ref dest_ref)
if(${source_ref})
set(${dest_ref} 1)