iOS: Do not enforce architecture for CMake builds

Do not set CMAKE_OSX_ARCHITECTURES, the defaults are fine.
It builds for x86_64 for Qt/Simulator/x86_64 and for arm64 for Qt/
Device/arm64 automatically, and then also for custom Qt/Simulator/arm64
builds that didn't work before because we enforced x86_64 for Simulator.

Task-number: QTBUG-101276
Change-Id: Ic33eab6d418210ad6384951e0b0f1972a2287a6b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Eike Ziller
2024-07-15 17:08:19 +02:00
parent 81f7325a0c
commit 2373c4c0a4

View File

@@ -1546,15 +1546,10 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id)
// and sysroot in the CMake configuration, but that currently doesn't work with Qt/CMake
// https://gitlab.kitware.com/cmake/cmake/-/issues/21276
const Id deviceType = DeviceTypeKitAspect::deviceTypeId(k);
// TODO the architectures are probably not correct with Apple Silicon in the mix...
const QString architecture = deviceType == Ios::Constants::IOS_DEVICE_TYPE
? QLatin1String("arm64")
: QLatin1String("x86_64");
const QString sysroot = deviceType == Ios::Constants::IOS_DEVICE_TYPE
? QLatin1String("iphoneos")
: QLatin1String("iphonesimulator");
cmd.addArg(CMAKE_QT6_TOOLCHAIN_FILE_ARG);
cmd.addArg("-DCMAKE_OSX_ARCHITECTURES:STRING=" + architecture);
cmd.addArg("-DCMAKE_OSX_SYSROOT:STRING=" + sysroot);
cmd.addArg("%{" + QLatin1String(DEVELOPMENT_TEAM_FLAG) + "}");
cmd.addArg("%{" + QLatin1String(PROVISIONING_PROFILE_FLAG) + "}");