summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/uikit
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2016-02-16 14:29:59 +0000
committerJake Petroules <jake.petroules@qt.io>2016-05-17 16:11:23 +0000
commit03e9c6f4a62582837fc9f5961ecbccd0a3d1b5d6 (patch)
treec52961c92f5968a7355941fa224dfc74268ce150 /mkspecs/features/uikit
parent26d44fce3dfb9dbd3b5be2a031fff8c1bb903960 (diff)
Add support for Apple tvOS
Pass -xplatform macx-tvos-clang to configure to build. Builds device and simulator by default. Added ‘uikit’ platform with the common setup. Also added QT_PLATFORM_UIKIT define (undocumented). qmake config defines tvos (but not ios). tvOS is 64bits only (QT_ARCH is arm64) and requires bitcode to be embedded in the binary. A new ‘bitcode’ configuration was added. For ReleaseDevice builds (which get archived and push to the store), bitcode is actually embedded (-fembed-bitcode passed to clang). For all other configurations, only using bitcode markers to keep file size down (-fembed-bitcode-marker). Build disables Widgets in qtbase, and qtscript (unsupported, would require fixes to JavaScriptCore source code). Qpa same as on iOS but disables device orientation, status bar, clipboard, menus, dialogs which are not supported on tvOS. Change-Id: I645804fd933be0befddeeb43095a74d2c178b2ba Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Diffstat (limited to 'mkspecs/features/uikit')
-rw-r--r--mkspecs/features/uikit/bitcode.prf13
-rw-r--r--mkspecs/features/uikit/default_post.prf18
-rw-r--r--mkspecs/features/uikit/default_pre.prf10
-rwxr-xr-xmkspecs/features/uikit/device_destinations.sh4
-rw-r--r--mkspecs/features/uikit/qt.prf2
-rw-r--r--mkspecs/features/uikit/qt_config.prf3
-rw-r--r--mkspecs/features/uikit/xcodebuild.prf10
7 files changed, 51 insertions, 9 deletions
diff --git a/mkspecs/features/uikit/bitcode.prf b/mkspecs/features/uikit/bitcode.prf
new file mode 100644
index 0000000000..ecc6542b3c
--- /dev/null
+++ b/mkspecs/features/uikit/bitcode.prf
@@ -0,0 +1,13 @@
+lessThan(QMAKE_XCODE_VERSION, "7.0") {
+ warning("You need to update Xcode to version 7 or newer to support bitcode")
+} else {
+ release:device {
+ QMAKE_CFLAGS += -fembed-bitcode
+ QMAKE_CXXFLAGS += -fembed-bitcode
+ QMAKE_OBJECTIVE_CFLAGS += -fembed-bitcode
+ } else {
+ QMAKE_CFLAGS += -fembed-bitcode-marker
+ QMAKE_CXXFLAGS += -fembed-bitcode-marker
+ QMAKE_OBJECTIVE_CFLAGS += -fembed-bitcode-marker
+ }
+}
diff --git a/mkspecs/features/uikit/default_post.prf b/mkspecs/features/uikit/default_post.prf
index f21d1e6427..7c92a24556 100644
--- a/mkspecs/features/uikit/default_post.prf
+++ b/mkspecs/features/uikit/default_post.prf
@@ -20,10 +20,11 @@ load(default_post)
macx-xcode {
device_family.name = TARGETED_DEVICE_FAMILY
- device_family.value = $$QMAKE_IOS_TARGETED_DEVICE_FAMILY
+ ios: device_family.value = $$QMAKE_IOS_TARGETED_DEVICE_FAMILY
+ tvos: device_family.value = $$QMAKE_TVOS_TARGETED_DEVICE_FAMILY
QMAKE_MAC_XCODE_SETTINGS += device_family
- {
+ ios {
# If QMAKE_BUNDLE_DATA contains an asset catalog that includes an
# AppIcon.appiconset, we configure Xcode to use it for app icons.
for(bundle_data, QMAKE_BUNDLE_DATA) {
@@ -66,11 +67,16 @@ macx-xcode {
macx-xcode {
arch_device.name = "ARCHS[sdk=$${device.sdk}*]"
arch_simulator.name = "ARCHS[sdk=$${simulator.sdk}*]"
- {
+ ios {
arch_device.value = $$QMAKE_IOS_DEVICE_ARCHS
arch_simulator.value = $$QMAKE_IOS_SIMULATOR_ARCHS
QMAKE_XCODE_ARCHS = $$QMAKE_IOS_DEVICE_ARCHS $$QMAKE_IOS_SIMULATOR_ARCHS
}
+ tvos {
+ arch_device.value = $$QMAKE_TVOS_DEVICE_ARCHS
+ arch_simulator.value = $$QMAKE_TVOS_SIMULATOR_ARCHS
+ QMAKE_XCODE_ARCHS = $$QMAKE_TVOS_DEVICE_ARCHS $$QMAKE_TVOS_SIMULATOR_ARCHS
+ }
QMAKE_MAC_XCODE_SETTINGS += arch_device arch_simulator
@@ -81,9 +87,11 @@ macx-xcode {
} else {
# Be more specific about which architecture we're targeting
contains(QT_ARCH, arm.*) {
- VALID_ARCHS = $$QMAKE_IOS_DEVICE_ARCHS
+ ios: VALID_ARCHS = $$QMAKE_IOS_DEVICE_ARCHS
+ tvos: VALID_ARCHS = $$QMAKE_TVOS_DEVICE_ARCHS
} else {
- VALID_ARCHS = $$QMAKE_IOS_SIMULATOR_ARCHS
+ ios: VALID_ARCHS = $$QMAKE_IOS_SIMULATOR_ARCHS
+ tvos: VALID_ARCHS = $$QMAKE_TVOS_SIMULATOR_ARCHS
}
single_arch: VALID_ARCHS = $$first(VALID_ARCHS)
diff --git a/mkspecs/features/uikit/default_pre.prf b/mkspecs/features/uikit/default_pre.prf
index a857c49007..cba5490b6e 100644
--- a/mkspecs/features/uikit/default_pre.prf
+++ b/mkspecs/features/uikit/default_pre.prf
@@ -19,3 +19,13 @@ simulator_and_device:iphonesimulator {
CONFIG -= neon
CONFIG += sse sse2
}
+simulator_and_device:appletvsimulator {
+ # For a simulator_and_device build all the config tests
+ # are based on the AppleTVOS ARM SDK, but we know that the simulator
+ # is x64 and that we support SSE/SSE2.
+ QT_ARCH = x64
+ QT_CPU_FEATURES.x64 = sse sse2
+ DEFINES += QT_COMPILER_SUPPORTS_SSE2
+ CONFIG -= neon
+ CONFIG += sse sse2
+}
diff --git a/mkspecs/features/uikit/device_destinations.sh b/mkspecs/features/uikit/device_destinations.sh
index 978e1149b5..af7cb91e85 100755
--- a/mkspecs/features/uikit/device_destinations.sh
+++ b/mkspecs/features/uikit/device_destinations.sh
@@ -54,6 +54,10 @@ xcodebuild test -scheme $2 -destination 'id=0' -destination-timeout 1 2>&1| sed
echo "HARDWARE_DEVICES += $id"
elif [ "$val" = "iOS Simulator" -a "$id" != "$booted_simulator" ]; then
echo "SIMULATOR_DEVICES += $id"
+ elif [ "$val" = "tvOS" ]; then
+ echo "HARDWARE_DEVICES += $id"
+ elif [ "$val" = "tvOS Simulator" -a "$id" != "$booted_simulator" ]; then
+ echo "SIMULATOR_DEVICES += $id"
fi
fi
done
diff --git a/mkspecs/features/uikit/qt.prf b/mkspecs/features/uikit/qt.prf
index 7edec819d5..af047be466 100644
--- a/mkspecs/features/uikit/qt.prf
+++ b/mkspecs/features/uikit/qt.prf
@@ -7,7 +7,7 @@ equals(TEMPLATE, app):contains(qt_depends, gui(-private)?) {
lib_path_and_base = $$[QT_INSTALL_PLUGINS/get]/platforms/lib$${lib_name}$$qtPlatformTargetSuffix()
LIBS += -l$${lib_name}$$qtPlatformTargetSuffix() $$fromfile($${lib_path_and_base}.prl, QMAKE_PRL_LIBS)
- {
+ !bitcode {
# By marking qt_registerPlatformPlugin as undefined, we ensure that
# the plugin.o translation unit is considered for inclusion in
# the final binary, which in turn ensures that the plugin's
diff --git a/mkspecs/features/uikit/qt_config.prf b/mkspecs/features/uikit/qt_config.prf
index 00e2c0c258..71e0982f7e 100644
--- a/mkspecs/features/uikit/qt_config.prf
+++ b/mkspecs/features/uikit/qt_config.prf
@@ -8,7 +8,8 @@ isEmpty(QT_ARCH) {
contains(QMAKE_MAC_SDK, $${device.sdk}.*) {
QT_ARCH = arm
} else { # Simulator
- QT_ARCH = i386
+ ios: QT_ARCH = i386
+ tvos: QT_ARCH = x64
}
# Prevent the arch/config tests from building as multi-arch binaries,
diff --git a/mkspecs/features/uikit/xcodebuild.prf b/mkspecs/features/uikit/xcodebuild.prf
index c6f20a5109..6e50bbcf50 100644
--- a/mkspecs/features/uikit/xcodebuild.prf
+++ b/mkspecs/features/uikit/xcodebuild.prf
@@ -35,8 +35,14 @@ CONFIG += no_default_goal_deps
DEVICE_SDK = $${device.sdk}
SIMULATOR_SDK = $${simulator.sdk}
-DEVICE_FILTER = "iPhone|iPad"
-GENERIC_DEVICE_DESTINATION = "generic/platform=iOS"
+ios {
+ DEVICE_FILTER = "iPhone|iPad"
+ GENERIC_DEVICE_DESTINATION = "generic/platform=iOS"
+}
+tvos {
+ DEVICE_FILTER = "Apple TV"
+ GENERIC_DEVICE_DESTINATION = "generic/platform=tvOS"
+}
QMAKE_EXTRA_VARIABLES += DEVICE_SDK SIMULATOR_SDK DEVICE_FILTER GENERIC_DEVICE_DESTINATION
QMAKE_EXTRA_INCLUDES += $$shell_quote($$PWD/xcodebuild.mk)