diff options
author | Jake Petroules <jake.petroules@theqtcompany.com> | 2015-09-08 22:46:10 -0700 |
---|---|---|
committer | Jake Petroules <jake.petroules@theqtcompany.com> | 2015-09-11 10:31:29 +0000 |
commit | 216ad20c09f160722598a6780e4271f0010bc616 (patch) | |
tree | c0d45fb354728e95c97eda4f53402b0be85c900d | |
parent | f75708f39dc6f3fc856615dea49b184af035465a (diff) |
Add skeleton tvOS support.
Change-Id: I234cec127b1644f1ef53fe5c287da7158152ac12
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
-rw-r--r-- | doc/reference/modules/cpp-module.qdoc | 8 | ||||
-rw-r--r-- | doc/reference/modules/xcode-module.qdoc | 8 | ||||
-rw-r--r-- | share/qbs/imports/qbs/DarwinTools/darwin-tools.js | 7 | ||||
-rw-r--r-- | share/qbs/modules/cpp/CppModule.qbs | 8 | ||||
-rw-r--r-- | share/qbs/modules/cpp/DarwinGCC.qbs | 2 | ||||
-rw-r--r-- | share/qbs/modules/cpp/tvos-gcc.qbs | 47 | ||||
-rw-r--r-- | share/qbs/modules/xcode/xcode.js | 4 | ||||
-rw-r--r-- | src/app/qbs-setup-toolchains/xcodeprobe.cpp | 17 |
8 files changed, 93 insertions, 8 deletions
diff --git a/doc/reference/modules/cpp-module.qdoc b/doc/reference/modules/cpp-module.qdoc index bd67a5acb..6b0bf30a8 100644 --- a/doc/reference/modules/cpp-module.qdoc +++ b/doc/reference/modules/cpp-module.qdoc @@ -462,6 +462,14 @@ \li A version number in the format [major].[minor] indicating the earliest version of Apple watchOS that the product should run on. If undefined, compiler defaults will be used. + \row + \li minimumTvosVersion + \li \c{string} + \li 1.5 + \li undefined, but may be set by generated profiles + \li A version number in the format [major].[minor] indicating the earliest version of + Apple tvOS that the product should run on. + If undefined, compiler defaults will be used. \endtable \section1 Properties Specific to Unix Platforms diff --git a/doc/reference/modules/xcode-module.qdoc b/doc/reference/modules/xcode-module.qdoc index 931b2f398..fab56a428 100644 --- a/doc/reference/modules/xcode-module.qdoc +++ b/doc/reference/modules/xcode-module.qdoc @@ -99,10 +99,10 @@ \li stringList \li 1.5 \li determined by \c{qbs.targetOS} - \li List of the Apple devices targeted by this product. For OS X and watchOS, this should - always be "mac" and "watch", respectively. For iOS, this can be one or both of - "iphone" and "ipad". The default is the list of all device types supported by the - current platform. + \li List of the Apple devices targeted by this product. For OS X, watchOS, and tvOS, this + should always be "mac", "watch", and "tv", respectively. For iOS, this can be one or + both of "iphone" and "ipad". The default is the list of all device types supported by + the current platform. \endtable \section1 Advanced Properties diff --git a/share/qbs/imports/qbs/DarwinTools/darwin-tools.js b/share/qbs/imports/qbs/DarwinTools/darwin-tools.js index bad0c1a0e..fb05a6f9c 100644 --- a/share/qbs/imports/qbs/DarwinTools/darwin-tools.js +++ b/share/qbs/imports/qbs/DarwinTools/darwin-tools.js @@ -58,6 +58,8 @@ function targetDevices(targetOS) { return ["mac"]; if (targetOS.contains("ios")) return ["iphone", "ipad"]; + if (targetOS.contains("tvos")) + return ["tv"]; if (targetOS.contains("watchos")) return ["watch"]; } @@ -73,7 +75,6 @@ function targetedDeviceFamily(deviceNames) { /** * Returns the most appropriate Apple platform name given a targetOS list. - * Possible platform names include macosx, iphoneos, and iphonesimulator. */ function applePlatformName(targetOSList) { if (targetOSList.contains("ios-simulator")) @@ -82,6 +83,10 @@ function applePlatformName(targetOSList) { return "iphoneos"; else if (targetOSList.contains("osx")) return "macosx"; + else if (targetOSList.contains("tvos-simulator")) + return "appletvsimulator"; + else if (targetOSList.contains("tvos")) + return "appletvos"; else if (targetOSList.contains("watchos-simulator")) return "watchsimulator"; else if (targetOSList.contains("watchos")) diff --git a/share/qbs/modules/cpp/CppModule.qbs b/share/qbs/modules/cpp/CppModule.qbs index 004abcc0e..e671b1cae 100644 --- a/share/qbs/modules/cpp/CppModule.qbs +++ b/share/qbs/modules/cpp/CppModule.qbs @@ -97,6 +97,14 @@ Module { defaults will be used." } + property string minimumTvosVersion + PropertyOptions { + name: "minimumTvosVersion" + description: "a version number in the format [major].[minor] indicating the earliest \ + version of tvOS that the product should run on. if undefined, compiler \ + defaults will be used." + } + property string minimumAndroidVersion PropertyOptions { name: "minimumAndroidVersion" diff --git a/share/qbs/modules/cpp/DarwinGCC.qbs b/share/qbs/modules/cpp/DarwinGCC.qbs index 6804ba089..78c2bb562 100644 --- a/share/qbs/modules/cpp/DarwinGCC.qbs +++ b/share/qbs/modules/cpp/DarwinGCC.qbs @@ -112,6 +112,8 @@ UnixGCC { env["MACOSX_DEPLOYMENT_TARGET"] = minimumOsxVersion || ""; if (qbs.targetOS.contains("watchos")) env["WATCHOS_DEPLOYMENT_TARGET"] = minimumWatchosVersion || ""; + if (qbs.targetOS.contains("tvos")) + env["TVOS_DEPLOYMENT_TARGET"] = minimumTvosVersion || ""; if (xcode.present) env["TARGETED_DEVICE_FAMILY"] = DarwinTools.targetedDeviceFamily(xcode.targetDevices); diff --git a/share/qbs/modules/cpp/tvos-gcc.qbs b/share/qbs/modules/cpp/tvos-gcc.qbs new file mode 100644 index 000000000..54922f8ef --- /dev/null +++ b/share/qbs/modules/cpp/tvos-gcc.qbs @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing +** +** This file is part of the Qt Build Suite. +** +** 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. +** +** In addition, 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. +** +****************************************************************************/ + +import qbs + +DarwinGCC { + condition: qbs.hostOS.contains('osx') && + qbs.targetOS.contains('tvos') && + qbs.toolchain && qbs.toolchain.contains('gcc') + + targetSystem: "tvos" + (minimumTvosVersion || "") + + minimumDarwinVersion: minimumTvosVersion + minimumDarwinVersionCompilerFlag: qbs.targetOS.contains("tvos-simulator") + ? "-mtvos-simulator-version-min" + : "-mtvos-version-min" + minimumDarwinVersionLinkerFlag: qbs.targetOS.contains("tvos-simulator") + ? "-tvos_simulator_version_min" + : "-tvos_version_min" +} diff --git a/share/qbs/modules/xcode/xcode.js b/share/qbs/modules/xcode/xcode.js index 7c259d3bc..bc0e973a8 100644 --- a/share/qbs/modules/xcode/xcode.js +++ b/share/qbs/modules/xcode/xcode.js @@ -42,6 +42,10 @@ function applePlatformDirectoryName(targetOSList, version, throwOnError) { return "iPhoneOS" + version; else if (targetOSList.contains("osx")) return "MacOSX" + version; + else if (targetOSList.contains("tvos-simulator")) + return "AppleTVSimulator" + version; + else if (targetOSList.contains("tvos")) + return "AppleTVOS" + version; else if (targetOSList.contains("watchos-simulator")) return "WatchSimulator" + version; else if (targetOSList.contains("watchos")) diff --git a/src/app/qbs-setup-toolchains/xcodeprobe.cpp b/src/app/qbs-setup-toolchains/xcodeprobe.cpp index 924936c51..2171ff1ca 100644 --- a/src/app/qbs-setup-toolchains/xcodeprobe.cpp +++ b/src/app/qbs-setup-toolchains/xcodeprobe.cpp @@ -122,6 +122,10 @@ static QStringList targetOSList(const QString &applePlatformName) targetOS << QStringLiteral("ios"); } else if (applePlatformName == QStringLiteral("iphonesimulator")) { targetOS << QStringLiteral("ios") << QStringLiteral("ios-simulator"); + } else if (applePlatformName == QStringLiteral("appletvos")) { + targetOS << QStringLiteral("tvos"); + } else if (applePlatformName == QStringLiteral("appletvsimulator")) { + targetOS << QStringLiteral("tvos") << QStringLiteral("tvos-simulator"); } else if (applePlatformName == QStringLiteral("watchos")) { targetOS << QStringLiteral("watchos"); } else if (applePlatformName == QStringLiteral("watchsimulator")) { @@ -137,12 +141,17 @@ static QStringList archList(const QString &applePlatformName) QStringList archs; if (applePlatformName == QStringLiteral("macosx") || applePlatformName == QStringLiteral("iphonesimulator") + || applePlatformName == QStringLiteral("appletvsimulator") || applePlatformName == QStringLiteral("watchsimulator")) { - archs << QStringLiteral("x86"); + if (applePlatformName != QStringLiteral("appletvsimulator")) + archs << QStringLiteral("x86"); if (applePlatformName != QStringLiteral("watchsimulator")) archs << QStringLiteral("x86_64"); - } else if (applePlatformName == QStringLiteral("iphoneos")) { - archs << QStringLiteral("armv7") << QStringLiteral("arm64"); + } else if (applePlatformName == QStringLiteral("iphoneos") + || applePlatformName == QStringLiteral("appletvos")) { + if (applePlatformName != QStringLiteral("appletvos")) + archs << QStringLiteral("armv7"); + archs << QStringLiteral("arm64"); } else if (applePlatformName == QStringLiteral("watchos")) { archs << QStringLiteral("armv7k"); } @@ -171,6 +180,8 @@ void XcodeProbe::setupDefaultToolchains(const QString &devPath, const QString &x platforms << QStringLiteral("macosx") << QStringLiteral("iphoneos") << QStringLiteral("iphonesimulator") + << QStringLiteral("appletvos") + << QStringLiteral("appletvsimulator") << QStringLiteral("watchos") << QStringLiteral("watchsimulator"); for (const QString &platform : platforms) { |