cmake: Move iOS detection into qt_auto_detect_ios

We don't need to deal with the input arguments to configure. We
can instead look at QT_QMAKE_TARGET_MKSPEC, like we do when we
auto detect other platforms. This handles both the -xplatform
and the -platform arguments.

Change-Id: I8d987d23e16bfa106833d521f67e8b5a931d9169
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Tor Arne Vestbø 2024-03-18 12:40:55 +01:00
parent 70e69f334e
commit 7826a96652
2 changed files with 5 additions and 6 deletions

View File

@ -178,6 +178,10 @@ function(qt_auto_detect_vcpkg)
endfunction()
function(qt_auto_detect_ios)
if("${QT_QMAKE_TARGET_MKSPEC}" STREQUAL "macx-ios-clang")
set(CMAKE_SYSTEM_NAME "iOS" CACHE STRING "")
endif()
if(CMAKE_SYSTEM_NAME STREQUAL iOS)
message(STATUS "Using internal CMake ${CMAKE_SYSTEM_NAME} toolchain file.")
@ -472,9 +476,9 @@ macro(qt_internal_setup_autodetect)
qt_auto_detect_cyclic_toolchain()
qt_auto_detect_cmake_config()
qt_auto_detect_darwin()
qt_auto_detect_macos_universal()
qt_auto_detect_ios()
qt_auto_detect_darwin()
qt_auto_detect_android()
qt_auto_detect_pch()
qt_auto_detect_wasm()

View File

@ -926,11 +926,6 @@ translate_string_input(android-javac-target QT_ANDROID_JAVAC_TARGET)
translate_string_input(sdk QT_APPLE_SDK)
if((DEFINED INPUT_xplatform AND INPUT_xplatform STREQUAL "macx-ios-clang")
OR (DEFINED INPUT_platform AND INPUT_platform STREQUAL "macx-ios-clang"))
push("-DCMAKE_SYSTEM_NAME=iOS")
endif()
drop_input(make)
drop_input(nomake)
translate_boolean_input(install-examples-sources QT_INSTALL_EXAMPLES_SOURCES)