summaryrefslogtreecommitdiffstats
path: root/mkspecs
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>2014-10-28 13:27:25 +0100
committerJani Heikkinen <jani.heikkinen@theqtcompany.com>2014-11-13 20:00:34 +0100
commit70ea4e2b294eeac51fc497191990842f48d1aff4 (patch)
tree6a7b86c3135b29169f8f06983cefeb22dae5a8bf /mkspecs
parent88b2f5e8686ee7b1b7f49012c964f2ec20d6c61e (diff)
iOS: Enable fat builds containing both armv7 and arm64 slices
Apple will from February 1, 2015, require all applications uploaded to the App Store to be built for both 32-bit (armv7/s) and 64-bit (arm64). https://developer.apple.com/news/?id=10202014a We enable fat Qt binaries by passing both -arch armv7 and -arch arm64 to clang, which takes care of lipoing together the two slices for each object file. This unfortunately means twice the build time and twice the binary size for our libraries. Since precompiled headers are architecture specific, and the -Xarch option can't be used with -include-pch, we need to disable precompiled headers globally. This can be improved in the future by switching to pretokenized headers (http://clang.llvm.org/docs/PTHInternals.html). Since we're enabling 64-bit ARM builds, we're also switching the simulator builds from i386 to fat i386 and x86_64 builds, so that we are able to test 64-bit builds using the simulator, but we're keeping i386 as the architecture Qt is aware of when it's building for simulator, as we need the CPU features to match the lowest common denominator. Change-Id: I277e60bddae549d24ca3c6301d842405180aded6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/macx-ios-clang/features/default_post.prf2
-rw-r--r--mkspecs/macx-ios-clang/features/qt_config.prf4
-rw-r--r--mkspecs/macx-ios-clang/qmake.conf4
3 files changed, 8 insertions, 2 deletions
diff --git a/mkspecs/macx-ios-clang/features/default_post.prf b/mkspecs/macx-ios-clang/features/default_post.prf
index 34fbac56d0..0245c948d9 100644
--- a/mkspecs/macx-ios-clang/features/default_post.prf
+++ b/mkspecs/macx-ios-clang/features/default_post.prf
@@ -209,6 +209,8 @@ macx-xcode {
else: \
VALID_ARCHS = $$QMAKE_IOS_SIMULATOR_ARCHS
+ single_arch: VALID_ARCHS = $$first(VALID_ARCHS)
+
ACTIVE_ARCHS = $(filter $(EXPORT_VALID_ARCHS), $(ARCHS))
ARCH_ARGS = $(foreach arch, $(if $(EXPORT_ACTIVE_ARCHS), $(EXPORT_ACTIVE_ARCHS), $(EXPORT_VALID_ARCHS)), -arch $(arch))
diff --git a/mkspecs/macx-ios-clang/features/qt_config.prf b/mkspecs/macx-ios-clang/features/qt_config.prf
index d9a13f65eb..d1a1a36933 100644
--- a/mkspecs/macx-ios-clang/features/qt_config.prf
+++ b/mkspecs/macx-ios-clang/features/qt_config.prf
@@ -9,4 +9,8 @@ isEmpty(QT_ARCH) {
QT_ARCH = arm
else: \ # Simulator
QT_ARCH = i386
+
+ # Prevent the arch/config tests from building as multi-arch binaries,
+ # as we only want the lowest common denominator features.
+ CONFIG += single_arch
}
diff --git a/mkspecs/macx-ios-clang/qmake.conf b/mkspecs/macx-ios-clang/qmake.conf
index 7b2e7a17e7..0c083edf80 100644
--- a/mkspecs/macx-ios-clang/qmake.conf
+++ b/mkspecs/macx-ios-clang/qmake.conf
@@ -15,8 +15,8 @@ DEFINES += DARWIN_NO_CARBON QT_NO_PRINTER QT_NO_PRINTDIALOG
# Universal target (iPhone and iPad)
QMAKE_IOS_TARGETED_DEVICE_FAMILY = 1,2
-QMAKE_IOS_DEVICE_ARCHS = armv7
-QMAKE_IOS_SIMULATOR_ARCHS = i386
+QMAKE_IOS_DEVICE_ARCHS = armv7 arm64
+QMAKE_IOS_SIMULATOR_ARCHS = i386 x86_64
include(../common/ios.conf)
include(../common/gcc-base-mac.conf)