summaryrefslogtreecommitdiffstats
path: root/mkspecs
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-09-21 15:16:21 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-09-21 19:53:21 +0000
commite06e7ab09d383ca05a77f44428a0686bac311df7 (patch)
treededc44056bc0eaf1dab1203f7b4afac90cad90ed /mkspecs
parentcc74e8da3f233ab53f57462d5f132137b64f8f6c (diff)
Pass -arch when running toolchain configure test on Apple platforms
Clang doesn't automatically switch architecture just because we're passing an iPhoneOS sysroot. In the past this resulted in a warning about trying to link an x86_64 binary to arm64 libraries, but with Xcode 12 this is now a hard error. Fixes: QTBUG-86718 Change-Id: I7e9d2ca513d276029fc2a6cfe694a35fe41c39b3 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit ac43986aa5d07685cc61a5dbc00d76abf0cd1017) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/features/toolchain.prf4
1 files changed, 4 insertions, 0 deletions
diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf
index 9d790f62bc..efbe7c1e55 100644
--- a/mkspecs/features/toolchain.prf
+++ b/mkspecs/features/toolchain.prf
@@ -182,6 +182,10 @@ isEmpty($${target_prefix}.INCDIRS) {
# UIKit simulator platforms will see the device SDK's sysroot in
# QMAKE_DEFAULT_*DIRS, because they're handled in a single build pass.
darwin {
+ # Clang doesn't pick up the architecture from the sysroot, and will
+ # default to the host architecture, so we need to manually set it.
+ cxx_flags += -arch $$QMAKE_APPLE_DEVICE_ARCHS
+
uikit:macx-xcode: \
cxx_flags += -isysroot $$sdk_path_device.value
else: \