CMake: Fix Apple max sdk version check
We need to warn only when using a major version that is the next one after the 'max supported version'. Add an assertion that the max sdk version specified in .cmake.conf needs to be just the major sdk version, without a minor or patch version component, otherwise the '+1' math expression will fail. Task-number: QTBUG-119490 Change-Id: Ib30abe7157c2ccbe0ad7a98e81fc241685a141a8 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit a0bdd2195f24d8a7d880ba506afc16b41337218e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
68b0fca6eb
commit
c98a4863dd
@ -812,6 +812,12 @@ function(_qt_internal_check_apple_sdk_and_xcode_versions)
|
||||
_qt_internal_get_cached_apple_sdk_version(sdk_version)
|
||||
_qt_internal_get_cached_xcode_version(xcode_version)
|
||||
|
||||
if(NOT max_sdk_version MATCHES "^[0-9]+$")
|
||||
message(FATAL_ERROR
|
||||
"Invalid max SDK version: ${max_sdk_version} "
|
||||
"It should be a major version number, without minor or patch version components.")
|
||||
endif()
|
||||
|
||||
# The default differs in different branches.
|
||||
set(failed_check_should_error FALSE)
|
||||
|
||||
@ -860,9 +866,9 @@ function(_qt_internal_check_apple_sdk_and_xcode_versions)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Upper bound checks should always be warnings, because the build might still work even
|
||||
# if untested.
|
||||
if(sdk_version VERSION_GREATER_EQUAL max_sdk_version)
|
||||
# Make sure we warn only when the current version is greater than the max supported version.
|
||||
math(EXPR next_after_max_sdk_version "${max_sdk_version} + 1")
|
||||
if(sdk_version VERSION_GREATER_EQUAL next_after_max_sdk_version)
|
||||
message(WARNING
|
||||
"Qt has only been tested with version ${max_sdk_version} "
|
||||
"of the platform SDK, you're using ${sdk_version}. "
|
||||
|
Loading…
x
Reference in New Issue
Block a user