aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@theqtcompany.com>2016-03-24 17:27:03 -0700
committerJake Petroules <jake.petroules@theqtcompany.com>2016-03-25 20:48:19 +0000
commit044c8607320e1dfcf0b984721334906a475f8415 (patch)
tree95aacfaaeb9610c2ce4693a0d9617106cd31af4d /share
parent26b53ffbe8e4ca98c1b549b6b502418dc6a4b1d4 (diff)
Introduce Array.containsAll and Array.containsAny.
Use where appropriate. Change-Id: Iaade46eab682e32d490dc718ec637930f4611c6c Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Diffstat (limited to 'share')
-rw-r--r--share/qbs/modules/bundle/BundleModule.qbs10
-rw-r--r--share/qbs/modules/cpp/DarwinGCC.qbs4
-rw-r--r--share/qbs/modules/cpp/gcc.js2
-rw-r--r--share/qbs/modules/cpp/genericunix-gcc.qbs2
-rw-r--r--share/qbs/modules/xcode/xcode.qbs8
5 files changed, 10 insertions, 16 deletions
diff --git a/share/qbs/modules/bundle/BundleModule.qbs b/share/qbs/modules/bundle/BundleModule.qbs
index ff0b67441..08c473356 100644
--- a/share/qbs/modules/bundle/BundleModule.qbs
+++ b/share/qbs/modules/bundle/BundleModule.qbs
@@ -81,11 +81,9 @@ Module {
additionalProductTypes: ["bundle"]
- property bool isBundle: qbs.targetOS.contains("darwin")
- && (product.type.contains("application")
- || product.type.contains("dynamiclibrary")
- || product.type.contains("loadablemodule"))
- && !product.consoleApplication
+ property bool isBundle: !product.consoleApplication && qbs.targetOS.contains("darwin") &&
+ product.type.containsAny(["application", "dynamiclibrary", "loadablemodule"])
+
readonly property bool isShallow: bundleSettingsProbe.xcodeSettings["SHALLOW_BUNDLE"] === "YES"
property string identifierPrefix: "org.example"
@@ -100,7 +98,7 @@ Module {
return "XPC!";
if (product.type.contains("application"))
return "APPL";
- if (product.type.contains("dynamiclibrary") || product.type.contains("staticlibrary"))
+ if (product.type.containsAny(["dynamiclibrary", "staticlibrary"]))
return "FMWK";
if (product.type.contains("kernelmodule"))
return "KEXT";
diff --git a/share/qbs/modules/cpp/DarwinGCC.qbs b/share/qbs/modules/cpp/DarwinGCC.qbs
index 6cb0fdc65..c83ae9eed 100644
--- a/share/qbs/modules/cpp/DarwinGCC.qbs
+++ b/share/qbs/modules/cpp/DarwinGCC.qbs
@@ -73,7 +73,7 @@ UnixGCC {
dict["LSMinimumSystemVersion"] = minimumOsxVersion;
}
- if (qbs.targetOS.contains("ios") || qbs.targetOS.contains("tvos")) {
+ if (qbs.targetOS.containsAny(["ios", "tvos"])) {
dict["LSRequiresIPhoneOS"] = true;
if (xcode.platformType === "device") {
@@ -90,7 +90,7 @@ UnixGCC {
if (qbs.targetOS.contains("ios"))
dict["UIDeviceFamily"] = targetDevices;
- if (qbs.targetOS.contains("ios") || qbs.targetOS.contains("watchos")) {
+ if (qbs.targetOS.containsAny(["ios", "watchos"])) {
var orientations = [
"UIInterfaceOrientationPortrait",
"UIInterfaceOrientationPortraitUpsideDown",
diff --git a/share/qbs/modules/cpp/gcc.js b/share/qbs/modules/cpp/gcc.js
index 0c65dc060..62e8552f8 100644
--- a/share/qbs/modules/cpp/gcc.js
+++ b/share/qbs/modules/cpp/gcc.js
@@ -98,7 +98,7 @@ function linkerFlags(product, inputs, output) {
if (output.fileTags.contains("loadablemodule"))
args.push(isDarwin ? "-bundle" : "-shared");
- if (output.fileTags.contains("dynamiclibrary") || output.fileTags.contains("loadablemodule")) {
+ if (output.fileTags.containsAny(["dynamiclibrary", "loadablemodule"])) {
if (isDarwin)
args = args.concat(escapeLinkerFlags(product, ["-headerpad_max_install_names"]));
else
diff --git a/share/qbs/modules/cpp/genericunix-gcc.qbs b/share/qbs/modules/cpp/genericunix-gcc.qbs
index fa330abed..7c8869d63 100644
--- a/share/qbs/modules/cpp/genericunix-gcc.qbs
+++ b/share/qbs/modules/cpp/genericunix-gcc.qbs
@@ -31,6 +31,6 @@
import qbs 1.0
UnixGCC {
- condition: !qbs.targetOS.contains('darwin') && !qbs.targetOS.contains('linux') &&
+ condition: qbs.targetOS && !qbs.targetOS.containsAny(['darwin', 'linux']) &&
qbs.toolchain && qbs.toolchain.contains('gcc') && !qbs.toolchain.contains('mingw')
}
diff --git a/share/qbs/modules/xcode/xcode.qbs b/share/qbs/modules/xcode/xcode.qbs
index b737bd358..1f3468081 100644
--- a/share/qbs/modules/xcode/xcode.qbs
+++ b/share/qbs/modules/xcode/xcode.qbs
@@ -17,13 +17,9 @@ Module {
property stringList targetDevices: DarwinTools.targetDevices(qbs.targetOS)
property string platformType: {
- if (qbs.targetOS.contains("ios-simulator")
- || qbs.targetOS.contains("tvos-simulator")
- || qbs.targetOS.contains("watchos-simulator"))
+ if (qbs.targetOS.containsAny(["ios-simulator", "tvos-simulator", "watchos-simulator"]))
return "simulator";
- if (qbs.targetOS.contains("ios")
- || qbs.targetOS.contains("tvos")
- || qbs.targetOS.contains("watchos"))
+ if (qbs.targetOS.containsAny(["ios", "tvos", "watchos"]))
return "device";
}