From 26f5a886ed4aa3c9b7a0a9c2d15494054033bb99 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Wed, 9 Sep 2015 19:12:13 -0700 Subject: Fix "else assumptions" and other conditionals relating to Apple OSes. Change-Id: I0d495d629919a19169a081abaa5a793b9dd251c6 Reviewed-by: Joerg Bornemann --- share/qbs/modules/bundle/BundleModule.qbs | 5 ++--- share/qbs/modules/cpp/DarwinGCC.qbs | 32 +++++++++++++++++++++---------- 2 files changed, 24 insertions(+), 13 deletions(-) (limited to 'share/qbs') diff --git a/share/qbs/modules/bundle/BundleModule.qbs b/share/qbs/modules/bundle/BundleModule.qbs index 0e3d9bb13..833aeb68b 100644 --- a/share/qbs/modules/bundle/BundleModule.qbs +++ b/share/qbs/modules/bundle/BundleModule.qbs @@ -45,7 +45,7 @@ Module { || product.type.contains("dynamiclibrary") || product.type.contains("loadablemodule")) && !product.consoleApplication - property bool isShallow: qbs.targetOS.contains("ios") && product.type.contains("application") + property bool isShallow: !qbs.targetOS.contains("osx") && product.type.contains("application") property string identifierPrefix: "org.example" property string identifier: [identifierPrefix, qbs.rfc1034Identifier(product.targetName)].join(".") @@ -102,8 +102,7 @@ Module { property string infoPlistFormat: { if (qbs.targetOS.contains("osx")) return infoPlistFile ? "same-as-input" : "xml1"; - else if (qbs.targetOS.contains("ios")) - return "binary1"; + return "binary1"; } property string localizedResourcesFolderSuffix: ".lproj" diff --git a/share/qbs/modules/cpp/DarwinGCC.qbs b/share/qbs/modules/cpp/DarwinGCC.qbs index 78c2bb562..6f066ab2d 100644 --- a/share/qbs/modules/cpp/DarwinGCC.qbs +++ b/share/qbs/modules/cpp/DarwinGCC.qbs @@ -71,26 +71,38 @@ UnixGCC { dict["LSMinimumSystemVersion"] = minimumOsxVersion; } - if (qbs.targetOS.contains("ios")) { + if (qbs.targetOS.contains("ios") || qbs.targetOS.contains("tvos")) { dict["LSRequiresIPhoneOS"] = true; - // architectures supported, to support iPhone 3G for example one has to add - // armv6 to the list and also compile for it (with Xcode 4.4.1 or earlier) - if (!qbs.targetOS.contains("ios-simulator")) - dict["UIRequiredDeviceCapabilities"] = [ "armv7" ]; + if (qbs.targetOS.contains("ios") && !qbs.targetOS.contains("ios-simulator")) + dict["UIRequiredDeviceCapabilities"] = ["armv7"]; + if (qbs.targetOS.contains("tvos") && !qbs.targetOS.contains("tvos-simulator")) + dict["UIRequiredDeviceCapabilities"] = ["arm64"]; + } + + var targetDevices = DarwinTools.targetedDeviceFamily(xcode.targetDevices); + if (qbs.targetOS.contains("ios") && xcode.present) + dict["UIDeviceFamily"] = targetDevices; + + if (qbs.targetOS.contains("ios") || qbs.targetOS.contains("watchos")) { var orientations = [ "UIInterfaceOrientationPortrait", + "UIInterfaceOrientationPortraitUpsideDown", "UIInterfaceOrientationLandscapeLeft", "UIInterfaceOrientationLandscapeRight" ]; - dict["UISupportedInterfaceOrientations"] = orientations; - orientations.splice(1, 0, "UIInterfaceOrientationPortraitUpsideDown"); - dict["UISupportedInterfaceOrientations~ipad"] = orientations; + if (targetDevices.contains("ipad")) + dict["UISupportedInterfaceOrientations~ipad"] = orientations; + + if (targetDevices.contains("watch")) + dict["UISupportedInterfaceOrientations"] = orientations.slice(0, 2); - if (xcode.present) - dict["UIDeviceFamily"] = DarwinTools.targetedDeviceFamily(xcode.targetDevices) + if (targetDevices.contains("iphone")) { + orientations.splice(1, 1); + dict["UISupportedInterfaceOrientations"] = orientations; + } } return dict; -- cgit v1.2.3