summaryrefslogtreecommitdiffstats
path: root/mkspecs
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
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')
-rw-r--r--mkspecs/common/ios.conf4
-rw-r--r--mkspecs/common/tvos.conf21
-rw-r--r--mkspecs/common/uikit.conf11
-rw-r--r--mkspecs/common/uikit/GLES2/gl2.h (renamed from mkspecs/common/ios/GLES2/gl2.h)0
-rw-r--r--mkspecs/features/mac/sdk.prf5
-rw-r--r--mkspecs/features/qt_build_config.prf2
-rw-r--r--mkspecs/features/qt_common.prf2
-rw-r--r--mkspecs/features/qt_functions.prf2
-rw-r--r--mkspecs/features/qt_parts.prf2
-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
-rw-r--r--mkspecs/macx-ios-clang/qmake.conf4
-rw-r--r--mkspecs/macx-tvos-clang/Info.plist.app41
-rw-r--r--mkspecs/macx-tvos-clang/Info.plist.lib22
-rw-r--r--mkspecs/macx-tvos-clang/qmake.conf21
-rw-r--r--mkspecs/macx-tvos-clang/qplatformdefs.h34
21 files changed, 210 insertions, 21 deletions
diff --git a/mkspecs/common/ios.conf b/mkspecs/common/ios.conf
index dea9a25efd..dd9b29f9e2 100644
--- a/mkspecs/common/ios.conf
+++ b/mkspecs/common/ios.conf
@@ -2,7 +2,7 @@
# qmake common configuration for iOS
#
-QMAKE_PLATFORM += ios uikit
+QMAKE_PLATFORM += ios
QMAKE_MAC_SDK = iphoneos
simulator.sdk = iphonesimulator
@@ -17,4 +17,4 @@ device.dir_affix = $${device.sdk}
device.CONFIG = $${device.sdk}
device.deployment_identifier = $${device.sdk}
-include(mac.conf)
+include(uikit.conf)
diff --git a/mkspecs/common/tvos.conf b/mkspecs/common/tvos.conf
new file mode 100644
index 0000000000..2db616f51e
--- /dev/null
+++ b/mkspecs/common/tvos.conf
@@ -0,0 +1,21 @@
+#
+# qmake common configuration for tvOS
+#
+
+QMAKE_PLATFORM += tvos
+QMAKE_MAC_SDK = appletvos
+CONFIG += bitcode
+
+simulator.sdk = appletvsimulator
+simulator.target = simulator
+simulator.dir_affix = $${simulator.sdk}
+simulator.CONFIG = $${simulator.sdk}
+simulator.deployment_identifier = tvos-simulator
+
+device.sdk = appletvos
+device.target = device
+device.dir_affix = $${device.sdk}
+device.CONFIG = $${device.sdk}
+device.deployment_identifier = $${device.sdk}
+
+include(uikit.conf)
diff --git a/mkspecs/common/uikit.conf b/mkspecs/common/uikit.conf
new file mode 100644
index 0000000000..d975ed98af
--- /dev/null
+++ b/mkspecs/common/uikit.conf
@@ -0,0 +1,11 @@
+#
+# qmake configuration for shared by UIKIT platforms
+#
+
+QMAKE_PLATFORM += uikit
+CONFIG += reduce_exports
+
+INCLUDEPATH += $$PWD/uikit
+DEFINES += DARWIN_NO_CARBON QT_NO_PRINTER QT_NO_PRINTDIALOG
+
+include(mac.conf)
diff --git a/mkspecs/common/ios/GLES2/gl2.h b/mkspecs/common/uikit/GLES2/gl2.h
index 0974509a35..0974509a35 100644
--- a/mkspecs/common/ios/GLES2/gl2.h
+++ b/mkspecs/common/uikit/GLES2/gl2.h
diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf
index ab37b1740f..c4d4c90f09 100644
--- a/mkspecs/features/mac/sdk.prf
+++ b/mkspecs/features/mac/sdk.prf
@@ -55,12 +55,13 @@ for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_
}
!equals(MAKEFILE_GENERATOR, XCODE) {
- ios:!host_build {
+ uikit:!host_build {
simulator: \
version_identifier = $$simulator.deployment_identifier
else: \
version_identifier = $$device.deployment_identifier
- deployment_target = $$QMAKE_IOS_DEPLOYMENT_TARGET
+ ios: deployment_target = $$QMAKE_IOS_DEPLOYMENT_TARGET
+ tvos: deployment_target = $$QMAKE_TVOS_DEPLOYMENT_TARGET
} else: osx {
version_identifier = macosx
deployment_target = $$QMAKE_MACOSX_DEPLOYMENT_TARGET
diff --git a/mkspecs/features/qt_build_config.prf b/mkspecs/features/qt_build_config.prf
index 2d437e7f91..ab183bf23b 100644
--- a/mkspecs/features/qt_build_config.prf
+++ b/mkspecs/features/qt_build_config.prf
@@ -64,7 +64,7 @@ CONFIG = qt_build_extra $$CONFIG
cross_compile: \
CONFIG += force_bootstrap
-android|ios|winrt: \
+android|uikit|winrt: \
CONFIG += builtin_testdata
CONFIG += \
diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf
index b060ff604e..4b110768bf 100644
--- a/mkspecs/features/qt_common.prf
+++ b/mkspecs/features/qt_common.prf
@@ -67,7 +67,7 @@ warnings_are_errors:warning_clean {
# If the module declares that it has does its clean-up of warnings, enable -Werror.
# This setting is compiler-dependent anyway because it depends on the version of the
# compiler.
- clang:!ios {
+ clang:!uikit {
# Apple clang 4.0-4.2,5.0-5.1,6.0-6.4
# Regular clang 3.3-3.8
apple_ver = $${QT_APPLE_CLANG_MAJOR_VERSION}.$${QT_APPLE_CLANG_MINOR_VERSION}
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
index cfac583ba8..2ed1cd51de 100644
--- a/mkspecs/features/qt_functions.prf
+++ b/mkspecs/features/qt_functions.prf
@@ -1,6 +1,6 @@
defineReplace(qtPlatformTargetSuffix) {
- ios:CONFIG(simulator, simulator|device): \
+ uikit:CONFIG(simulator, simulator|device): \
suffix = _$${simulator.sdk}
else: \
suffix =
diff --git a/mkspecs/features/qt_parts.prf b/mkspecs/features/qt_parts.prf
index 877bd60321..fa62f40e35 100644
--- a/mkspecs/features/qt_parts.prf
+++ b/mkspecs/features/qt_parts.prf
@@ -60,7 +60,7 @@ exists($$_PRO_FILE_PWD_/tests/tests.pro) {
sub_tests.CONFIG = no_default_install
!contains(QT_BUILD_PARTS, tests) {
sub_tests.CONFIG += no_default_target
- } else: !ios {
+ } else: !uikit {
# Make sure these are there in case we need them
sub_tools.CONFIG -= no_default_target
sub_examples.CONFIG -= no_default_target
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)
diff --git a/mkspecs/macx-ios-clang/qmake.conf b/mkspecs/macx-ios-clang/qmake.conf
index 595b11e7c1..94eff0d237 100644
--- a/mkspecs/macx-ios-clang/qmake.conf
+++ b/mkspecs/macx-ios-clang/qmake.conf
@@ -2,12 +2,8 @@
# qmake configuration for macx-ios-clang
#
-QMAKE_MACOSX_DEPLOYMENT_TARGET =
QMAKE_IOS_DEPLOYMENT_TARGET = 7.0
-INCLUDEPATH += $$PWD/ios
-DEFINES += DARWIN_NO_CARBON QT_NO_PRINTER QT_NO_PRINTDIALOG
-
# Universal target (iPhone and iPad)
QMAKE_IOS_TARGETED_DEVICE_FAMILY = 1,2
diff --git a/mkspecs/macx-tvos-clang/Info.plist.app b/mkspecs/macx-tvos-clang/Info.plist.app
new file mode 100644
index 0000000000..618989d63d
--- /dev/null
+++ b/mkspecs/macx-tvos-clang/Info.plist.app
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleGetInfoString</key>
+ <string>Created by Qt/QMake</string>
+ <key>CFBundleSignature</key>
+ <string>@TYPEINFO@</string>
+ <key>CFBundleExecutable</key>
+ <string>@EXECUTABLE@</string>
+ <key>CFBundleIdentifier</key>
+ <string>@BUNDLEIDENTIFIER@</string>
+ <key>CFBundleDisplayName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>CFBundleIcons</key>
+ <dict>
+ <key>CFBundlePrimaryIcon</key>
+ <string>App Icon - Small</string>
+ </dict>
+ <key>CFBundleSupportedPlatforms</key>
+ <array>
+ <string>AppleTVOS</string>
+ </array>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>MinimumOSVersion</key>
+ <string>9.1</string>
+ <key>NOTE</key>
+ <string>This file was generated by Qt/QMake.</string>
+</dict>
+</plist>
diff --git a/mkspecs/macx-tvos-clang/Info.plist.lib b/mkspecs/macx-tvos-clang/Info.plist.lib
new file mode 100644
index 0000000000..7cbdb9af12
--- /dev/null
+++ b/mkspecs/macx-tvos-clang/Info.plist.lib
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleShortVersionString</key>
+ <string>@SHORT_VERSION@</string>
+ <key>CFBundleVersion</key>
+ <string>@FULL_VERSION@</string>
+ <key>CFBundleGetInfoString</key>
+ <string>Created by Qt/QMake</string>
+ <key>CFBundleSignature</key>
+ <string>@TYPEINFO@</string>
+ <key>CFBundleExecutable</key>
+ <string>@LIBRARY@</string>
+ <key>CFBundleIdentifier</key>
+ <string>@BUNDLEIDENTIFIER@</string>
+ <key>NOTE</key>
+ <string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
+</dict>
+</plist>
diff --git a/mkspecs/macx-tvos-clang/qmake.conf b/mkspecs/macx-tvos-clang/qmake.conf
new file mode 100644
index 0000000000..f389382450
--- /dev/null
+++ b/mkspecs/macx-tvos-clang/qmake.conf
@@ -0,0 +1,21 @@
+#
+# qmake configuration for macx-tvos-clang
+#
+
+QMAKE_TVOS_DEPLOYMENT_TARGET = 9.1
+
+INCLUDEPATH += $$PWD/tvos
+
+QMAKE_TVOS_TARGETED_DEVICE_FAMILY = 3
+
+QMAKE_TVOS_DEVICE_ARCHS = arm64
+QMAKE_TVOS_SIMULATOR_ARCHS = x86_64
+
+include(../common/tvos.conf)
+include(../common/gcc-base-mac.conf)
+include(../common/clang.conf)
+include(../common/clang-mac.conf)
+include(../common/ios/clang.conf)
+include(../common/ios/qmake.conf)
+
+load(qt_config)
diff --git a/mkspecs/macx-tvos-clang/qplatformdefs.h b/mkspecs/macx-tvos-clang/qplatformdefs.h
new file mode 100644
index 0000000000..68020de6d5
--- /dev/null
+++ b/mkspecs/macx-tvos-clang/qplatformdefs.h
@@ -0,0 +1,34 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the qmake spec of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "../common/mac/qplatformdefs.h"