aboutsummaryrefslogtreecommitdiffstats
path: root/share/qbs/modules/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'share/qbs/modules/cpp')
-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
11 files changed, 31 insertions, 28 deletions
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