Skip to content

Commit

Permalink
cmake: Propagate Apple platform build requirements to qconfig.pri
Browse files Browse the repository at this point in the history
So we don't have to maintain the requirements in two places.

None of the variables removed from the qmake configs are
referenced before we do load(qt_config), so this should
be safe.

Pick-to: 6.7
Change-Id: Iabd5884a2fd1c4b1cd7b44416bebb2624050229e
Reviewed-by: Alexandru Croitor <[email protected]>
  • Loading branch information
torarnv committed Mar 14, 2024
1 parent d8371eb commit 640a3f2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
19 changes: 17 additions & 2 deletions cmake/QtPriHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -787,8 +787,23 @@ QT_PATCH_VERSION = ${PROJECT_VERSION_PATCH}

if(APPLE)
list(APPEND extra_statements "QT_MAC_SDK_VERSION = ${QT_MAC_SDK_VERSION}")
list(APPEND extra_statements
"QMAKE_MACOSX_DEPLOYMENT_TARGET = ${CMAKE_OSX_DEPLOYMENT_TARGET}")
if(NOT CMAKE_SYSTEM_NAME OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
# macOS
list(APPEND extra_statements
"QMAKE_MACOSX_DEPLOYMENT_TARGET = ${CMAKE_OSX_DEPLOYMENT_TARGET}")
list(APPEND extra_statements
"QT_MAC_SDK_VERSION_MIN = ${QT_SUPPORTED_MIN_MACOS_SDK_VERSION}")
list(APPEND extra_statements
"QT_MAC_SDK_VERSION_MAX = ${QT_SUPPORTED_MAX_MACOS_SDK_VERSION}")
elseif(CMAKE_SYSTEM_NAME STREQUAL iOS)
list(APPEND extra_statements
"QMAKE_IOS_DEPLOYMENT_TARGET = ${CMAKE_OSX_DEPLOYMENT_TARGET}")
list(APPEND extra_statements
"QT_MAC_SDK_VERSION_MIN = ${QT_SUPPORTED_MIN_IOS_SDK_VERSION}")
list(APPEND extra_statements
"QT_MAC_SDK_VERSION_MAX = ${QT_SUPPORTED_MAX_IOS_SDK_VERSION}")
endif()

if (CMAKE_OSX_ARCHITECTURES)
list(APPEND architectures "${CMAKE_OSX_ARCHITECTURES}")
string (REPLACE ";" " " architectures "${architectures}")
Expand Down
6 changes: 0 additions & 6 deletions mkspecs/common/macx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
QMAKE_PLATFORM += macos osx macx
QMAKE_MAC_SDK = macosx

QMAKE_MACOSX_DEPLOYMENT_TARGET = 12

QT_MAC_SDK_VERSION_MIN = 12

QT_MAC_SDK_VERSION_MAX = 14

device.sdk = macosx
device.target = device
device.dir_affix = $${device.sdk}
Expand Down
2 changes: 0 additions & 2 deletions mkspecs/macx-ios-clang/qmake.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# qmake configuration for macx-ios-clang
#

QMAKE_IOS_DEPLOYMENT_TARGET = 16.0

# Universal target (iPhone and iPad)
QMAKE_APPLE_TARGETED_DEVICE_FAMILY = 1,2

Expand Down

0 comments on commit 640a3f2

Please sign in to comment.