Cleanup the watchOS and tvOS References from CMake files

In addition, I simplified some of the routines as we don't need the
extra check for them.

Task-number: QTBUG-107903
Pick-to: 6.4
Change-Id: Idaf6ab1338a54bc1a9f242fcc8400ae200174beb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Amir Masoud Abdol 2022-10-25 13:47:31 +02:00
parent 7943cdcde7
commit f157e223c2

View File

@ -187,9 +187,7 @@ function(qt_auto_detect_vcpkg)
endfunction() endfunction()
function(qt_auto_detect_ios) function(qt_auto_detect_ios)
if(CMAKE_SYSTEM_NAME STREQUAL iOS if(CMAKE_SYSTEM_NAME STREQUAL iOS)
OR CMAKE_SYSTEM_NAME STREQUAL watchOS
OR CMAKE_SYSTEM_NAME STREQUAL tvOS)
message(STATUS "Using internal CMake ${CMAKE_SYSTEM_NAME} toolchain file.") message(STATUS "Using internal CMake ${CMAKE_SYSTEM_NAME} toolchain file.")
# The QT_UIKIT_SDK check simulates the input.sdk condition for simulator_and_device in # The QT_UIKIT_SDK check simulates the input.sdk condition for simulator_and_device in
@ -206,9 +204,8 @@ function(qt_auto_detect_ios)
message(STATUS "simulator_and_device set to: \"${simulator_and_device}\".") message(STATUS "simulator_and_device set to: \"${simulator_and_device}\".")
# Choose relevant architectures. # Choose relevant architectures.
# Using a non xcode generator requires explicit setting of the # Using a non Xcode generator requires explicit setting of the
# architectures, otherwise compilation fails with unknown defines. # architectures, otherwise compilation fails with unknown defines.
if(CMAKE_SYSTEM_NAME STREQUAL iOS)
if(simulator_and_device) if(simulator_and_device)
set(osx_architectures "arm64;x86_64") set(osx_architectures "arm64;x86_64")
elseif(QT_UIKIT_SDK STREQUAL "iphoneos") elseif(QT_UIKIT_SDK STREQUAL "iphoneos")
@ -224,39 +221,6 @@ function(qt_auto_detect_ios)
"Unknown SDK argument given to QT_UIKIT_SDK: ${QT_UIKIT_SDK}.") "Unknown SDK argument given to QT_UIKIT_SDK: ${QT_UIKIT_SDK}.")
endif() endif()
endif() endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL tvOS)
if(simulator_and_device)
set(osx_architectures "arm64;x86_64")
elseif(QT_UIKIT_SDK STREQUAL "appletvos")
set(osx_architectures "arm64")
elseif(QT_UIKIT_SDK STREQUAL "appletvsimulator")
set(osx_architectures "x86_64")
else()
if(NOT DEFINED QT_UIKIT_SDK)
message(FATAL_ERROR "Please provide a value for -DQT_UIKIT_SDK."
" Possible values: appletvos, appletvsimulator.")
else()
message(FATAL_ERROR
"Unknown SDK argument given to QT_UIKIT_SDK: ${QT_UIKIT_SDK}.")
endif()
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL watchOS)
if(simulator_and_device)
set(osx_architectures "armv7k;i386")
elseif(QT_UIKIT_SDK STREQUAL "watchos")
set(osx_architectures "armv7k")
elseif(QT_UIKIT_SDK STREQUAL "watchsimulator")
set(osx_architectures "i386")
else()
if(NOT DEFINED QT_UIKIT_SDK)
message(FATAL_ERROR "Please provide a value for -DQT_UIKIT_SDK."
" Possible values: watchos, watchsimulator.")
else()
message(FATAL_ERROR
"Unknown SDK argument given to QT_UIKIT_SDK: ${QT_UIKIT_SDK}.")
endif()
endif()
endif()
# For non simulator_and_device builds, we need to explicitly set the SYSROOT aka the sdk # For non simulator_and_device builds, we need to explicitly set the SYSROOT aka the sdk
# value. # value.
@ -312,10 +276,6 @@ function(qt_internal_get_darwin_sdk_version out_var)
if(APPLE) if(APPLE)
if(IOS) if(IOS)
set(sdk_name "iphoneos") set(sdk_name "iphoneos")
elseif(TVOS)
set(sdk_name "appletvos")
elseif(WATCHOS)
set(sdk_name "watchos")
else() else()
# Default to macOS # Default to macOS
set(sdk_name "macosx") set(sdk_name "macosx")
@ -357,10 +317,6 @@ function(qt_auto_detect_darwin)
set(version "10.15") set(version "10.15")
elseif(CMAKE_SYSTEM_NAME STREQUAL iOS) elseif(CMAKE_SYSTEM_NAME STREQUAL iOS)
set(version "14.0") set(version "14.0")
elseif(CMAKE_SYSTEM_NAME STREQUAL watchOS)
set(version "7.0")
elseif(CMAKE_SYSTEM_NAME STREQUAL tvOS)
set(version "14.0")
endif() endif()
if(version) if(version)
set(CMAKE_OSX_DEPLOYMENT_TARGET "${version}" CACHE STRING "${description}") set(CMAKE_OSX_DEPLOYMENT_TARGET "${version}" CACHE STRING "${description}")
@ -373,9 +329,8 @@ function(qt_auto_detect_darwin)
qt_internal_get_xcode_version(xcode_version) qt_internal_get_xcode_version(xcode_version)
set(QT_MAC_XCODE_VERSION "${xcode_version}" CACHE STRING "Xcode version.") set(QT_MAC_XCODE_VERSION "${xcode_version}" CACHE STRING "Xcode version.")
set(device_names "iOS" "watchOS" "tvOS")
list(LENGTH CMAKE_OSX_ARCHITECTURES arch_count) list(LENGTH CMAKE_OSX_ARCHITECTURES arch_count)
if(NOT CMAKE_SYSTEM_NAME IN_LIST device_names AND arch_count GREATER 0) if(NOT CMAKE_SYSTEM_NAME STREQUAL iOS AND arch_count GREATER 0)
foreach(arch ${CMAKE_OSX_ARCHITECTURES}) foreach(arch ${CMAKE_OSX_ARCHITECTURES})
if(arch STREQUAL "arm64e") if(arch STREQUAL "arm64e")
message(WARNING "Applications built against an arm64e Qt architecture will " message(WARNING "Applications built against an arm64e Qt architecture will "
@ -388,8 +343,7 @@ function(qt_auto_detect_darwin)
endfunction() endfunction()
function(qt_auto_detect_macos_universal) function(qt_auto_detect_macos_universal)
set(device_names "iOS" "watchOS" "tvOS") if(APPLE AND NOT CMAKE_SYSTEM_NAME STREQUAL iOS)
if(APPLE AND NOT CMAKE_SYSTEM_NAME IN_LIST device_names)
list(LENGTH CMAKE_OSX_ARCHITECTURES arch_count) list(LENGTH CMAKE_OSX_ARCHITECTURES arch_count)
set(is_universal "OFF") set(is_universal "OFF")