qtbase/cmake/QtWindowsHelpers.cmake
Joerg Bornemann 9a409295c7 CMake: Check minimum MSVC version when configuring Qt
MSVC 2019 support was dropped from Qt 6.8. Bail out early if someone
wants to build Qt with it.

One can opt out of the version check by setting the CMake variable
QT_NO_MSVC_MIN_VERSION_CHECK to ON.

Pick-to: 6.8
Change-Id: Ia1f5668e1cddcd0c9f0a8d50482fb50d0c5afe7e
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2024-12-06 15:26:38 +01:00

17 lines
603 B
CMake

# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
function(qt_internal_check_msvc_versions)
if(NOT MSVC OR QT_NO_MSVC_MIN_VERSION_CHECK)
return()
endif()
set(min_msvc_version "1930")
if(MSVC_VERSION VERSION_LESS min_msvc_version)
message(FATAL_ERROR
"Qt requires at least Visual Studio 2019 (MSVC ${min_msvc_version} or newer), "
"you're building against version ${MSVC_VERSION}. "
"You can turn off this version check by setting QT_NO_MSVC_MIN_VERSION_CHECK to ON."
)
endif()
endfunction()