aboutsummaryrefslogtreecommitdiffstats
path: root/share/qbs/modules
diff options
context:
space:
mode:
Diffstat (limited to 'share/qbs/modules')
-rw-r--r--share/qbs/modules/Qt/core/qtcore.qbs14
-rw-r--r--share/qbs/modules/Qt/gui/qtgui.qbs2
-rw-r--r--share/qbs/modules/Qt/opengl/opengl.qbs2
-rw-r--r--share/qbs/modules/Qt/qtfunctions.js4
-rw-r--r--share/qbs/modules/cpp/DarwinGCC.qbs8
-rw-r--r--share/qbs/modules/cpp/GenericGCC.qbs12
-rw-r--r--share/qbs/modules/cpp/bundle-tools.js2
-rw-r--r--share/qbs/modules/cpp/gcc.js10
-rw-r--r--share/qbs/modules/cpp/genericunix-gcc.qbs2
-rw-r--r--share/qbs/modules/cpp/ios-gcc.qbs12
-rw-r--r--share/qbs/modules/cpp/linux-gcc.qbs2
-rw-r--r--share/qbs/modules/cpp/osx-gcc.qbs2
-rw-r--r--share/qbs/modules/cpp/path-tools.js5
-rw-r--r--share/qbs/modules/cpp/windows-mingw.qbs2
-rw-r--r--share/qbs/modules/cpp/windows-msvc.qbs2
-rw-r--r--share/qbs/modules/qbs/common.qbs18
16 files changed, 46 insertions, 53 deletions
diff --git a/share/qbs/modules/Qt/core/qtcore.qbs b/share/qbs/modules/Qt/core/qtcore.qbs
index f126946d7..da77b3e10 100644
--- a/share/qbs/modules/Qt/core/qtcore.qbs
+++ b/share/qbs/modules/Qt/core/qtcore.qbs
@@ -46,7 +46,7 @@ Module {
defines.push("QT_NO_DEBUG");
if (namespace)
defines.push("QT_NAMESPACE=" + namespace);
- if (qbs.targetOS === "ios")
+ if (qbs.targetOS.contains("ios"))
defines = defines.concat(["DARWIN_NO_CARBON", "QT_NO_CORESERVICES", "QT_NO_PRINTER",
"QT_NO_PRINTDIALOG", "main=qt_main"]);
return defines;
@@ -67,14 +67,14 @@ Module {
return libPaths;
}
cpp.staticLibraries: {
- if (qbs.targetOS === 'windows' && !product.consoleApplication)
+ if (qbs.targetOS.contains('windows') && !product.consoleApplication)
return ["qtmain" + libInfix + (cpp.debugInformation ? "d" : "") + (!qbs.toolchain.contains("mingw") ? ".lib" : "")];
}
cpp.dynamicLibraries: {
var libs = [];
if (!frameworkBuild)
libs=[QtFunctions.getQtLibraryName('Core' + libInfix, qtcore, qbs)];
- if (qbs.targetOS === 'ios' && staticBuild)
+ if (qbs.targetOS.contains('ios') && staticBuild)
libs = libs.concat(["z", "m",
QtFunctions.getQtLibraryName("PlatformSupport", qtcore, qbs),
QtFunctions.getPlatformLibraryName("qiosmain", qtcore, qbs)]);
@@ -82,7 +82,7 @@ Module {
return undefined;
return libs;
}
- cpp.linkerFlags: ((qbs.targetOS === 'ios' && staticBuild) ?
+ cpp.linkerFlags: ((qbs.targetOS.contains('ios') && staticBuild) ?
["-force_load", pluginPath + "/platforms/" +
QtFunctions.getPlatformLibraryName("libqios", qtcore, qbs) + ".a"] : undefined)
cpp.frameworkPaths: frameworkBuild ? [libPath] : undefined
@@ -90,13 +90,13 @@ Module {
var frameworks = [];
if (frameworkBuild)
frameworks = [QtFunctions.getQtLibraryName('Core' + libInfix, qtcore, qbs)]
- if (qbs.targetOS === 'ios' && staticBuild)
+ if (qbs.targetOS.contains('ios') && staticBuild)
frameworks = frameworks.concat(["Foundation", "CoreFoundation"]);
if (frameworks.length === 0)
return undefined;
return frameworks;
}
- cpp.rpaths: qbs.targetOS === 'linux' ? [libPath] : undefined
+ cpp.rpaths: qbs.targetOS.contains('linux') ? [libPath] : undefined
cpp.positionIndependentCode: versionMajor >= 5 ? true : undefined
cpp.cxxFlags: {
var flags;
@@ -129,7 +129,7 @@ Module {
if (v.length > 0 && v.charAt(0) != ';')
v = ';' + v
var y = binPath
- if (qbs.targetOS === 'windows')
+ if (qbs.targetOS.contains('windows'))
v = FileInfo.toWindowsSeparators(y) + v
else
v = y + v
diff --git a/share/qbs/modules/Qt/gui/qtgui.qbs b/share/qbs/modules/Qt/gui/qtgui.qbs
index 6eec29b26..619d22ce6 100644
--- a/share/qbs/modules/Qt/gui/qtgui.qbs
+++ b/share/qbs/modules/Qt/gui/qtgui.qbs
@@ -33,7 +33,7 @@ QtModule {
}
Properties {
- condition: Qt.core.staticBuild && qbs.targetOS == "ios"
+ condition: Qt.core.staticBuild && qbs.targetOS.contains("ios")
cpp.frameworks: base.concat(["UIKit", "QuartzCore", "CoreText", "CoreGraphics",
"Foundation", "CoreFoundation"])
}
diff --git a/share/qbs/modules/Qt/opengl/opengl.qbs b/share/qbs/modules/Qt/opengl/opengl.qbs
index c3a5c137d..e7934802e 100644
--- a/share/qbs/modules/Qt/opengl/opengl.qbs
+++ b/share/qbs/modules/Qt/opengl/opengl.qbs
@@ -4,7 +4,7 @@ import '../QtModule.qbs' as QtModule
QtModule {
qtModuleName: 'OpenGL'
Properties {
- condition: Qt.core.staticBuild && qbs.targetOS == "ios"
+ condition: Qt.core.staticBuild && qbs.targetOS.contains("ios")
cpp.frameworks: base.concat(["OpenGLES", "QuartzCore", "CoreGraphics"])
}
cpp.frameworks: base
diff --git a/share/qbs/modules/Qt/qtfunctions.js b/share/qbs/modules/Qt/qtfunctions.js
index e19c16901..7e54d1a1f 100644
--- a/share/qbs/modules/Qt/qtfunctions.js
+++ b/share/qbs/modules/Qt/qtfunctions.js
@@ -3,14 +3,14 @@
function getPlatformLibraryName(name, qtcore, qbs)
{
var libName = name;
- if (qbs.targetOS === 'windows') {
+ if (qbs.targetOS.contains('windows')) {
libName += (qbs.enableDebugCode ? 'd' : '');
if (qtcore.versionMajor < 5)
libName += qtcore.versionMajor;
if (!qbs.toolchain.contains("mingw"))
libName += '.lib';
}
- if (qbs.targetPlatform.indexOf("darwin") !== -1) {
+ if (qbs.targetOS.contains("darwin")) {
if (!qtcore.frameworkBuild && qtcore.buildVariant.indexOf("debug") !== -1 &&
(qtcore.buildVariant.indexOf("release") === -1 || qbs.enableDebugCode))
libName += '_debug';
diff --git a/share/qbs/modules/cpp/DarwinGCC.qbs b/share/qbs/modules/cpp/DarwinGCC.qbs
index 9c6fd53c4..5fd6213ce 100644
--- a/share/qbs/modules/cpp/DarwinGCC.qbs
+++ b/share/qbs/modules/cpp/DarwinGCC.qbs
@@ -58,10 +58,10 @@ UnixGCC {
if (product.type.indexOf("applicationbundle") !== -1)
dict["CFBundleIconFile"] = product.targetName;
- if (qbs.targetOS === "osx" && minimumOsxVersion)
+ if (qbs.targetOS.contains("osx") && minimumOsxVersion)
dict["LSMinimumSystemVersion"] = minimumOsxVersion;
- if (qbs.targetOS === "ios") {
+ if (qbs.targetOS.contains("ios")) {
dict["LSRequiresIPhoneOS"] = true;
// architectures supported, to support iPhone 3G for example one has to add
@@ -177,7 +177,7 @@ UnixGCC {
aggregatePlist[key] = props[key];
}
- if (product.moduleProperty("qbs", "targetOS") === "ios") {
+ if (product.moduleProperty("qbs", "targetOS").contains("ios")) {
key = "UIDeviceFamily";
if (key in platformInfo && !(key in aggregatePlist))
aggregatePlist[key] = platformInfo[key];
@@ -237,7 +237,7 @@ UnixGCC {
// Convert the written file to the format appropriate for the current platform
process = new Process();
process.start("plutil", ["-convert",
- product.moduleProperty("qbs", "targetOS") === "ios"
+ product.moduleProperty("qbs", "targetOS").contains("ios")
? "binary1" : "xml1",
outputs.infoplist[0].fileName]);
process.waitForFinished();
diff --git a/share/qbs/modules/cpp/GenericGCC.qbs b/share/qbs/modules/cpp/GenericGCC.qbs
index f474e28fc..af87a26d0 100644
--- a/share/qbs/modules/cpp/GenericGCC.qbs
+++ b/share/qbs/modules/cpp/GenericGCC.qbs
@@ -68,7 +68,7 @@ CppModule {
var i;
var args = Gcc.configFlags(product);
args.push('-shared');
- if (product.moduleProperty("qbs", "targetOS") === 'linux') {
+ if (product.moduleProperty("qbs", "targetOS").contains('linux')) {
args = args.concat([
'-Wl,--hash-style=gnu',
'-Wl,--as-needed',
@@ -76,7 +76,7 @@ CppModule {
'-Wl,--no-undefined',
'-Wl,-soname=' + Gcc.soname()
]);
- } else if (product.moduleProperty("qbs", "targetPlatform").indexOf('darwin') !== -1) {
+ } else if (product.moduleProperty("qbs", "targetOS").contains('darwin')) {
var installNamePrefix = product.moduleProperty("cpp", "installNamePrefix");
if (installNamePrefix !== undefined)
args.push("-Wl,-install_name,"
@@ -90,7 +90,7 @@ CppModule {
args.push(inputs.obj[i].fileName);
var sysroot = ModUtils.moduleProperty(product, "sysroot")
if (sysroot) {
- if (product.moduleProperty("qbs", "targetPlatform").indexOf('darwin') !== -1)
+ if (product.moduleProperty("qbs", "targetOS").contains('darwin'))
args.push('-isysroot', sysroot);
else
args.push('--sysroot=' + sysroot);
@@ -127,7 +127,7 @@ CppModule {
// Create symlinks from {libfoo, libfoo.1, libfoo.1.0} to libfoo.1.0.0
if (product.version
- && product.moduleProperty("qbs", "targetPlatform").indexOf("unix") !== -1) {
+ && product.moduleProperty("qbs", "targetOS").contains("unix")) {
var versionParts = product.version.split('.');
var version = "";
var fname = FileInfo.fileName(output.fileName);
@@ -213,7 +213,7 @@ CppModule {
args.push(inputs.obj[i].fileName)
var sysroot = ModUtils.moduleProperty(product, "sysroot")
if (sysroot) {
- if (product.moduleProperty("qbs", "targetPlatform").indexOf('darwin') !== -1)
+ if (product.moduleProperty("qbs", "targetOS").contains('darwin'))
args.push('-isysroot', sysroot)
else
args.push('--sysroot=' + sysroot)
@@ -271,7 +271,7 @@ CppModule {
}
}
- if (product.moduleProperty("qbs", "targetOS") === 'linux') {
+ if (product.moduleProperty("qbs", "targetOS").contains('linux')) {
var transitiveSOs = ModUtils.modulePropertiesFromArtifacts(product, inputs.dynamiclibrary, 'cpp', 'transitiveSOs')
for (i in transitiveSOs) {
args.push("-Wl,-rpath-link=" + FileInfo.path(transitiveSOs[i]))
diff --git a/share/qbs/modules/cpp/bundle-tools.js b/share/qbs/modules/cpp/bundle-tools.js
index e51c18928..32243a4d6 100644
--- a/share/qbs/modules/cpp/bundle-tools.js
+++ b/share/qbs/modules/cpp/bundle-tools.js
@@ -203,7 +203,7 @@ function scriptsFolderPath(product, version)
// iOS tends to store the majority of files in its bundles in the main directory
function isShallowBundle(product)
{
- return product.moduleProperty("qbs", "targetOS") === "ios"
+ return product.moduleProperty("qbs", "targetOS").contains("ios")
&& product.type.indexOf("applicationbundle") !== -1;
}
diff --git a/share/qbs/modules/cpp/gcc.js b/share/qbs/modules/cpp/gcc.js
index 30b175dec..b7f4b1f60 100644
--- a/share/qbs/modules/cpp/gcc.js
+++ b/share/qbs/modules/cpp/gcc.js
@@ -101,7 +101,7 @@ function additionalCompilerFlags(product, includePaths, frameworkPaths, systemIn
}
var sysroot = ModUtils.moduleProperty(product, "sysroot")
if (sysroot) {
- if (product.moduleProperty("qbs", "targetPlatform").indexOf('darwin') !== -1)
+ if (product.moduleProperty("qbs", "targetOS").contains('darwin'))
args.push('-isysroot', sysroot);
else
args.push('--sysroot=' + sysroot);
@@ -126,7 +126,7 @@ function additionalCompilerFlags(product, includePaths, frameworkPaths, systemIn
args.push('-iframework' + systemFrameworkPaths[i]);
var minimumWindowsVersion = ModUtils.moduleProperty(product, "minimumWindowsVersion");
- if (minimumWindowsVersion && product.moduleProperty("qbs", "targetOS") === "windows") {
+ if (minimumWindowsVersion && product.moduleProperty("qbs", "targetOS").contains("windows")) {
var hexVersion = Windows.getWindowsVersionInFormat(minimumWindowsVersion, 'hex');
if (hexVersion) {
var versionDefs = [ 'WINVER', '_WIN32_WINNT', '_WIN32_WINDOWS' ];
@@ -148,12 +148,12 @@ function additionalCompilerAndLinkerFlags(product) {
var args = []
var minimumOsxVersion = ModUtils.moduleProperty(product, "minimumOsxVersion");
- if (minimumOsxVersion && product.moduleProperty("qbs", "targetOS") === "osx")
+ if (minimumOsxVersion && product.moduleProperty("qbs", "targetOS").contains("osx"))
args.push('-mmacosx-version-min=' + minimumOsxVersion);
var minimumiOSVersion = ModUtils.moduleProperty(product, "minimumIosVersion");
- if (minimumiOSVersion && product.moduleProperty("qbs", "targetOS") === "ios") {
- if (product.moduleProperty("qbs", "architecture") === "x86")
+ if (minimumiOSVersion && product.moduleProperty("qbs", "targetOS").contains("ios")) {
+ if (product.moduleProperty("qbs", "targetOS").contains("ios-simulator"))
args.push('-mios-simulator-version-min=' + minimumiOSVersion);
else
args.push('-miphoneos-version-min=' + minimumiOSVersion);
diff --git a/share/qbs/modules/cpp/genericunix-gcc.qbs b/share/qbs/modules/cpp/genericunix-gcc.qbs
index 7ccdc7ebf..68589b469 100644
--- a/share/qbs/modules/cpp/genericunix-gcc.qbs
+++ b/share/qbs/modules/cpp/genericunix-gcc.qbs
@@ -1,5 +1,5 @@
import qbs 1.0
UnixGCC {
- condition: qbs.targetOS === 'unix' && qbs.toolchain.contains('gcc')
+ condition: qbs.targetOS.contains('unix') && qbs.toolchain.contains('gcc')
}
diff --git a/share/qbs/modules/cpp/ios-gcc.qbs b/share/qbs/modules/cpp/ios-gcc.qbs
index ef169911b..79b49e316 100644
--- a/share/qbs/modules/cpp/ios-gcc.qbs
+++ b/share/qbs/modules/cpp/ios-gcc.qbs
@@ -5,15 +5,17 @@ import 'darwin-tools.js' as DarwinTools
import 'bundle-tools.js' as BundleTools
DarwinGCC {
- condition: qbs.hostOS === 'osx' && qbs.targetOS === 'ios' && qbs.toolchain.contains('gcc')
+ condition: qbs.hostOS.contains('osx') && qbs.targetOS.contains('ios') && qbs.toolchain.contains('gcc')
property string signingIdentity
property string provisionFile
- property bool buildIpa: qbs.architecture.match("^arm") === "arm"
+ property bool buildIpa: !qbs.targetOS.contains('ios-simulator')
visibility: "hidden"
- optimization: ((qbs.buildVariant === "debug" ) ? "none" :
- (qbs.architecture.match("^arm") === "arm") ? "small" :
- "fast")
+ optimization: {
+ if (qbs.buildVariant === "debug")
+ return "none";
+ return qbs.targetOS.contains('ios-simulator') ? "fast" : "small"
+ }
platformCommonCompilerFlags: base.concat(["-fvisibility-inlines-hidden", "-g", "-gdwarf-2", "-fPIE"])
commonCompilerFlags: ["-fpascal-strings", "-fexceptions", "-fasm-blocks", "-fstrict-aliasing"]
diff --git a/share/qbs/modules/cpp/linux-gcc.qbs b/share/qbs/modules/cpp/linux-gcc.qbs
index 495f2cd7d..63281f7cb 100644
--- a/share/qbs/modules/cpp/linux-gcc.qbs
+++ b/share/qbs/modules/cpp/linux-gcc.qbs
@@ -1,7 +1,7 @@
import qbs 1.0
UnixGCC {
- condition: qbs.targetOS === 'linux' && qbs.toolchain.contains('gcc')
+ condition: qbs.targetOS.contains('linux') && qbs.toolchain.contains('gcc')
rpaths: ['$ORIGIN']
}
diff --git a/share/qbs/modules/cpp/osx-gcc.qbs b/share/qbs/modules/cpp/osx-gcc.qbs
index 563b81422..eb6fefc50 100644
--- a/share/qbs/modules/cpp/osx-gcc.qbs
+++ b/share/qbs/modules/cpp/osx-gcc.qbs
@@ -2,5 +2,5 @@ import qbs 1.0
import '../utils.js' as ModUtils
DarwinGCC {
- condition: qbs.hostOS === 'osx' && qbs.targetOS === 'osx' && qbs.toolchain.contains('gcc')
+ condition: qbs.hostOS.contains('osx') && qbs.targetOS.contains('osx') && qbs.toolchain.contains('gcc')
}
diff --git a/share/qbs/modules/cpp/path-tools.js b/share/qbs/modules/cpp/path-tools.js
index 1a7071729..db45c89f6 100644
--- a/share/qbs/modules/cpp/path-tools.js
+++ b/share/qbs/modules/cpp/path-tools.js
@@ -42,7 +42,8 @@ function dynamicLibraryFileName(version)
var fileName = ModUtils.moduleProperty(product, "dynamicLibraryPrefix") + product.targetName;
// For Darwin platforms, append the version number if there is one (i.e. libqbs.1.0.0)
- if (version && product.moduleProperty("qbs", "targetPlatform").indexOf("darwin") !== -1) {
+ var targetOS = product.moduleProperty("qbs", "targetOS");
+ if (version && targetOS.contains("darwin")) {
fileName += "." + version;
version = undefined;
}
@@ -51,7 +52,7 @@ function dynamicLibraryFileName(version)
fileName += ModUtils.moduleProperty(product, "dynamicLibrarySuffix");
// For non-Darwin Unix platforms, append the version number if there is one (i.e. libqbs.so.1.0.0)
- if (version && product.moduleProperty("qbs", "targetPlatform").indexOf("unix") !== -1)
+ if (version && targetOS.contains("unix") && !targetOS.contains("darwin"))
fileName += "." + version;
return fileName;
diff --git a/share/qbs/modules/cpp/windows-mingw.qbs b/share/qbs/modules/cpp/windows-mingw.qbs
index a9d8e55d5..e01914097 100644
--- a/share/qbs/modules/cpp/windows-mingw.qbs
+++ b/share/qbs/modules/cpp/windows-mingw.qbs
@@ -3,7 +3,7 @@ import qbs.fileinfo as FileInfo
import '../utils.js' as ModUtils
GenericGCC {
- condition: qbs.targetOS === "windows" && qbs.toolchain.contains("mingw")
+ condition: qbs.targetOS.contains("windows") && qbs.toolchain.contains("mingw")
staticLibraryPrefix: "lib"
dynamicLibraryPrefix: ""
executablePrefix: ""
diff --git a/share/qbs/modules/cpp/windows-msvc.qbs b/share/qbs/modules/cpp/windows-msvc.qbs
index bb4f2d5aa..5d22d6eff 100644
--- a/share/qbs/modules/cpp/windows-msvc.qbs
+++ b/share/qbs/modules/cpp/windows-msvc.qbs
@@ -7,7 +7,7 @@ import "bundle-tools.js" as BundleTools // needed for path-tools.js
import 'path-tools.js' as PathTools
CppModule {
- condition: qbs.hostOS === 'windows' && qbs.targetOS === 'windows' && qbs.toolchain.contains('msvc')
+ condition: qbs.hostOS.contains('windows') && qbs.targetOS.contains('windows') && qbs.toolchain.contains('msvc')
id: module
diff --git a/share/qbs/modules/qbs/common.qbs b/share/qbs/modules/qbs/common.qbs
index 9c47a3b12..c650aadba 100644
--- a/share/qbs/modules/qbs/common.qbs
+++ b/share/qbs/modules/qbs/common.qbs
@@ -6,20 +6,10 @@ Module {
property bool enableDebugCode: buildVariant == "debug"
property bool debugInformation: (buildVariant == "debug")
property string optimization: (buildVariant == "debug" ? "none" : "fast")
- property string hostOS: getHostOS()
- property string pathListSeparator: hostOS === "windows" ? ";" : ":"
- property string pathSeparator: hostOS === "windows" ? "\\" : "/"
- property string targetOS: hostOS
- property var targetPlatform: {
- var platforms = [targetOS];
- if (targetOS === "linux")
- platforms.push("unix");
- else if (targetOS === "android")
- platforms.push("linux", "unix");
- else if (targetOS === "osx" || targetOS === "ios")
- platforms.push("darwin", "unix");
- return platforms
- }
+ property stringList hostOS: getHostOS()
+ property stringList targetOS
+ property string pathListSeparator: hostOS.contains("windows") ? ";" : ":"
+ property string pathSeparator: hostOS.contains("windows") ? "\\" : "/"
property string profile
property stringList toolchain
property string architecture