From e3b36b65429f505522db2522798e72b334a11308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 21 Mar 2024 19:34:30 +0100 Subject: [PATCH] qmake: Improve Xcode projects for single SDK builds on Apple platforms Xcode expects the base SDK to always be the device SDK, so we can't pass QMAKE_MAC_SDK on directly. We use the Xcode SUPPORTED_PLATFORMS setting to inform Xcode about which targets we can actually build and run for. Change-Id: I32f474a9f2016fb410225cfef1fecc6598ac6c82 Reviewed-by: Alexandru Croitor --- mkspecs/features/uikit/default_post.prf | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mkspecs/features/uikit/default_post.prf b/mkspecs/features/uikit/default_post.prf index 0cac4c0177..a731cd0cbe 100644 --- a/mkspecs/features/uikit/default_post.prf +++ b/mkspecs/features/uikit/default_post.prf @@ -40,6 +40,18 @@ macx-xcode { } QMAKE_BUNDLE_DATA += qmake_launch_screens } + + !qtConfig(simulator_and_device) { + # Single SDK builds only support the target we built + supported_platforms.name = SUPPORTED_PLATFORMS + supported_platforms.value = $$QMAKE_MAC_SDK + QMAKE_MAC_XCODE_SETTINGS += supported_platforms + } + + # In a simulator specific build the device config will set the SDK + # to the simulator SDK, but for Xcode we always want the SDKROOT + # to be the device SDK. + QMAKE_MAC_SDK = $$device.sdk } !xcodebuild:equals(TEMPLATE, app):!isEmpty(QMAKE_INFO_PLIST) {