diff options
author | Jake Petroules <jake.petroules@petroules.com> | 2015-06-09 23:51:11 -0700 |
---|---|---|
committer | Jake Petroules <jake.petroules@petroules.com> | 2015-07-29 19:17:36 +0000 |
commit | 248ed3e0e0e809f8994c2e8983db830fbc2bdb21 (patch) | |
tree | 1f8fdeed2626e9315f52d343d848124b306dc3b3 /share/qbs/modules | |
parent | e8963d2a2ff314355ec6a44df2647eb84eda634f (diff) |
Introduce xcode.targetDevices.
This primarily allows users to control whether they are developing
universal or device-specific iOS applications.
Change-Id: I64fe7a3b9da383c51a7b24d013111a2da3993e58
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Diffstat (limited to 'share/qbs/modules')
-rw-r--r-- | share/qbs/modules/cpp/DarwinGCC.qbs | 6 | ||||
-rw-r--r-- | share/qbs/modules/ib/IBModule.qbs | 2 | ||||
-rw-r--r-- | share/qbs/modules/ib/ib.js | 13 | ||||
-rw-r--r-- | share/qbs/modules/xcode/xcode.qbs | 6 |
4 files changed, 19 insertions, 8 deletions
diff --git a/share/qbs/modules/cpp/DarwinGCC.qbs b/share/qbs/modules/cpp/DarwinGCC.qbs index 05e40d9d3..355b1f0ad 100644 --- a/share/qbs/modules/cpp/DarwinGCC.qbs +++ b/share/qbs/modules/cpp/DarwinGCC.qbs @@ -29,6 +29,7 @@ ****************************************************************************/ import qbs +import qbs.DarwinTools import qbs.FileInfo import qbs.ModUtils @@ -83,6 +84,9 @@ UnixGCC { dict["UISupportedInterfaceOrientations"] = orientations; orientations.splice(1, 0, "UIInterfaceOrientationPortraitUpsideDown"); dict["UISupportedInterfaceOrientations~ipad"] = orientations; + + if (xcode.present) + dict["UIDeviceFamily"] = DarwinTools.targetedDeviceFamily(xcode.targetDevices) } return dict; @@ -99,6 +103,8 @@ UnixGCC { env["IPHONEOS_DEPLOYMENT_TARGET"] = minimumIosVersion; if (qbs.targetOS.contains("osx") && minimumOsxVersion) env["MACOSX_DEPLOYMENT_TARGET"] = minimumOsxVersion; + if (xcode.present) + env["TARGETED_DEVICE_FAMILY"] = DarwinTools.targetedDeviceFamily(xcode.targetDevices); return env; } } diff --git a/share/qbs/modules/ib/IBModule.qbs b/share/qbs/modules/ib/IBModule.qbs index dd52984e5..9de1907a8 100644 --- a/share/qbs/modules/ib/IBModule.qbs +++ b/share/qbs/modules/ib/IBModule.qbs @@ -79,6 +79,8 @@ Module { property int ibtoolVersionMinor: ibtoolVersionParts[1] property int ibtoolVersionPatch: ibtoolVersionParts[2] + property stringList targetDevices: xcode.targetDevices + property path actoolOutputDirectory: { var dir = product.destinationDirectory; if (bundle.isBundle) diff --git a/share/qbs/modules/ib/ib.js b/share/qbs/modules/ib/ib.js index 72ec78c20..335040758 100644 --- a/share/qbs/modules/ib/ib.js +++ b/share/qbs/modules/ib/ib.js @@ -116,14 +116,11 @@ function ibtooldArguments(product, inputs, outputs, overrideOutput) { args.push("--output-partial-info-plist", outputs.partial_infoplist[0].filePath); } - if (product.moduleProperty("qbs", "targetOS").contains("osx")) - args.push("--target-device", "mac"); - - if (product.moduleProperty("qbs", "targetOS").contains("ios")) { - // TODO: Only output the devices specified in TARGET_DEVICE_FAMILY - // We can't get this info from Info.plist keys due to dependency order - args.push("--target-device", "iphone"); - args.push("--target-device", "ipad"); + // For iOS, we'd normally only output the devices specified in TARGETED_DEVICE_FAMILY + // We can't get this info from Info.plist keys due to dependency order, so use the qbs prop + var targetDevices = ModUtils.moduleProperty(product, "targetDevices"); + for (i in targetDevices) { + args.push("--target-device", targetDevices[i]); } } diff --git a/share/qbs/modules/xcode/xcode.qbs b/share/qbs/modules/xcode/xcode.qbs index c363ff101..a8464b330 100644 --- a/share/qbs/modules/xcode/xcode.qbs +++ b/share/qbs/modules/xcode/xcode.qbs @@ -11,6 +11,12 @@ Module { property path developerPath: "/Applications/Xcode.app/Contents/Developer" property string sdk: DarwinTools.applePlatformName(qbs.targetOS) + property stringList targetDevices: { + if (qbs.targetOS.contains("osx")) + return ["mac"]; + if (qbs.targetOS.contains("ios")) + return ["iphone", "ipad"]; + } readonly property string sdkName: { if (_sdkSettings) { |