From cfdf9a19bf0770d17478c549743381a7547eb460 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 15 Aug 2022 17:24:41 +0200 Subject: qmake: Fix non-Xcode asset catalog handling for iOS simulator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If an iOS project was built with qmake using the Makefile generator instead of the Xcode generator, so -spec macx-ios-clang, and not -spec macx-xcode, Asset catalog processing failed with an actool error like Unknown platform: "ios-simulator" This is because we used the deployment identifier (which is meant for creation of the -mios-simulator-version-min flag) to pass a value to actool's -platform option, rather than the sdk name. Introduce a new variable called platform_identifier, which will be set to the currently processed macOS/iOS sdk name (e.g. macosx, iphonesimulator, iphoneos). Use it when processing asset catalogs using the Makefile generator. Relates to 9daeb6fe9d35b10ed739ea0a0566533524ffd532 Amends 5574aa986b69277881fe5fc694d97514c668024f Fixes: QTBUG-102053 Change-Id: Ic4ea3b9e11c21ae535d6544cbed3670f9db44e72 Reviewed-by: Jörg Bornemann (cherry picked from commit e38956e4f754ef8faa2ee4e76b787d71c773dcdb) Reviewed-by: Qt Cherry-pick Bot --- mkspecs/features/mac/asset_catalogs.prf | 2 +- mkspecs/features/mac/default_post.prf | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'mkspecs') diff --git a/mkspecs/features/mac/asset_catalogs.prf b/mkspecs/features/mac/asset_catalogs.prf index 58211c13a2..1b9745a132 100644 --- a/mkspecs/features/mac/asset_catalogs.prf +++ b/mkspecs/features/mac/asset_catalogs.prf @@ -68,7 +68,7 @@ $$asset_catalog_app_icon_arg \ $$asset_catalog_launch_image_arg \ --output-partial-info-plist $$shell_quote($$asset_catalog_compiler.target) \ - --platform $${version_identifier} \ + --platform $${platform_identifier} \ --minimum-deployment-target $${deployment_target} \ --compile $$shell_quote($$QMAKE_ASSET_CATALOGS_BUILD_PATH) diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf index abc6d82ade..09db1764b1 100644 --- a/mkspecs/features/mac/default_post.prf +++ b/mkspecs/features/mac/default_post.prf @@ -208,9 +208,11 @@ macx-xcode { contains(VALID_SIMULATOR_ARCHS, $$arch) { sdk = $$simulator.sdk version_identifier = $$simulator.deployment_identifier + platform_identifier = $$simulator.sdk } else { sdk = $$device.sdk version_identifier = $$device.deployment_identifier + platform_identifier = $$device.sdk } version_min_flags = \ @@ -237,9 +239,11 @@ macx-xcode { } else { simulator { version_identifier = $$simulator.deployment_identifier + platform_identifier = $$simulator.sdk sysroot_path = $$xcodeSDKInfo(Path, $$simulator.sdk) } else { version_identifier = $$device.deployment_identifier + platform_identifier = $$device.sdk sysroot_path = $$xcodeSDKInfo(Path, $$device.sdk) } version_min_flag = -m$${version_identifier}-version-min=$$deployment_target -- cgit v1.2.3