diff --git a/cmake/QtPublicAppleHelpers.cmake b/cmake/QtPublicAppleHelpers.cmake index 5d366a5c98c..ad7dd05e0b5 100644 --- a/cmake/QtPublicAppleHelpers.cmake +++ b/cmake/QtPublicAppleHelpers.cmake @@ -844,9 +844,9 @@ function(_qt_internal_get_cached_xcode_version out_var) set(${out_var} "${xcode_version}" PARENT_SCOPE) endfunction() -# Warn when the platform SDK or Xcode version are not supported. +# Warn or error out when the platform SDK or Xcode version are not supported. # -# The warnings are currently only shown when building Qt, not when building user projects +# The messages are currently only shown when building Qt, not when building user projects # with CMake. # The warnings ARE shown for qmake user projects. # @@ -891,11 +891,14 @@ function(_qt_internal_check_apple_sdk_and_xcode_versions) endif() # The default differs in different branches. - set(failed_check_should_error FALSE) + set(failed_check_should_error TRUE) if(failed_check_should_error) # Allow downgrading the error into a warning. - if(QT_FORCE_WARN_APPLE_SDK_AND_XCODE_CHECK) + # + # Our cmake build tests might be executed on older not officially supported Xcode or SDK + # versions in the CI. Downgrade the error in this case as well. + if(QT_FORCE_WARN_APPLE_SDK_AND_XCODE_CHECK OR QT_INTERNAL_IS_CMAKE_BUILD_TEST) set(message_type WARNING) set(extra_message " Due to QT_FORCE_WARN_APPLE_SDK_AND_XCODE_CHECK being ON " "the build will continue, but it will likely fail. Use at your own risk.") diff --git a/src/corelib/Qt6CTestMacros.cmake b/src/corelib/Qt6CTestMacros.cmake index 1edcb1bab5e..f6bdb3b3cc8 100644 --- a/src/corelib/Qt6CTestMacros.cmake +++ b/src/corelib/Qt6CTestMacros.cmake @@ -142,6 +142,9 @@ function(_qt_internal_get_cmake_test_configure_options out_var) list(APPEND option_list "-DQT_BUILD_DIR=${QT_BUILD_DIR}") endif() + # Pass a variable that can serve as a marker for cmake build tests in other build system code. + list(APPEND option_list "-DQT_INTERNAL_IS_CMAKE_BUILD_TEST=ON") + if(APPLE AND CMAKE_OSX_ARCHITECTURES) list(LENGTH CMAKE_OSX_ARCHITECTURES osx_arch_count)