qmake: Fix non-Xcode asset catalog handling for iOS simulator

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 9daeb6fe9d
Amends 5574aa986b

Pick-to: 6.3 6.4
Fixes: QTBUG-102053
Change-Id: Ic4ea3b9e11c21ae535d6544cbed3670f9db44e72
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Alexandru Croitor 2022-08-15 17:24:41 +02:00
parent 0ed8987078
commit e38956e4f7
2 changed files with 5 additions and 1 deletions

View File

@ -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)

View File

@ -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