From 7826a96652c7236817023e2d94b1c9b801edb53f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 18 Mar 2024 12:40:55 +0100 Subject: [PATCH] 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 --- cmake/QtAutoDetectHelpers.cmake | 6 +++++- cmake/QtProcessConfigureArgs.cmake | 5 ----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/cmake/QtAutoDetectHelpers.cmake b/cmake/QtAutoDetectHelpers.cmake index c24aa2d0b00..36fb377bdba 100644 --- a/cmake/QtAutoDetectHelpers.cmake +++ b/cmake/QtAutoDetectHelpers.cmake @@ -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() diff --git a/cmake/QtProcessConfigureArgs.cmake b/cmake/QtProcessConfigureArgs.cmake index 68584dfc612..5e2b92a19cf 100644 --- a/cmake/QtProcessConfigureArgs.cmake +++ b/cmake/QtProcessConfigureArgs.cmake @@ -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)