diff options
author | Fawzi Mohamed <fawzi.mohamed@digia.com> | 2013-03-19 22:00:27 +0100 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@digia.com> | 2013-03-21 18:00:13 +0100 |
commit | ded9902af9df3fc15fe7de511302af2e1001f48c (patch) | |
tree | a216e22a14fce3c9f63c60087fbd222906aa150c /share | |
parent | 7f215d8ae98a744a9c76933e9fdc09e970c166ee (diff) |
Improve iOS toolchain detection
Change-Id: I4f82e4aa39d34834a4d90f2301fb865345f2ce8b
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'share')
-rw-r--r-- | share/qbs/modules/cpp/GenericGCC.qbs | 17 | ||||
-rw-r--r-- | share/qbs/modules/cpp/gcc.js | 8 | ||||
-rw-r--r-- | share/qbs/modules/qbs/common.qbs | 2 |
3 files changed, 20 insertions, 7 deletions
diff --git a/share/qbs/modules/cpp/GenericGCC.qbs b/share/qbs/modules/cpp/GenericGCC.qbs index 050ac83ff..2b56d242f 100644 --- a/share/qbs/modules/cpp/GenericGCC.qbs +++ b/share/qbs/modules/cpp/GenericGCC.qbs @@ -13,6 +13,7 @@ CppModule { compilerName: 'g++' property string archiverName: 'ar' property string sysroot: qbs.sysroot + property string platformPath property string toolchainPathPrefix: { var path = '' @@ -80,8 +81,12 @@ CppModule { for (i in inputs.obj) args.push(inputs.obj[i].fileName); var sysroot = ModUtils.moduleProperty(product, "sysroot") - if (sysroot) - args.push('--sysroot=' + sysroot) + if (sysroot) { + if (product.moduleProperty("qbs", "targetPlatform").indexOf('darwin') !== -1) + args.push('-isysroot', sysroot); + else + args.push('--sysroot=' + sysroot); + } var staticLibrariesI = []; for (i in inputs.staticlibrary) { staticLibrariesI.push(inputs.staticlibrary[i].fileName); @@ -185,8 +190,12 @@ CppModule { for (var i in inputs.obj) args.push(inputs.obj[i].fileName) var sysroot = ModUtils.moduleProperty(product, "sysroot") - if (sysroot) - args.push('--sysroot=' + sysroot) + if (sysroot) { + if (product.moduleProperty("qbs", "targetPlatform").indexOf('darwin') !== -1) + args.push('-isysroot', sysroot) + else + args.push('--sysroot=' + sysroot) + } args = args.concat(platformLinkerFlags); for (i in linkerFlags) args.push(linkerFlags[i]) diff --git a/share/qbs/modules/cpp/gcc.js b/share/qbs/modules/cpp/gcc.js index e4b4e793c..3adf50b55 100644 --- a/share/qbs/modules/cpp/gcc.js +++ b/share/qbs/modules/cpp/gcc.js @@ -84,8 +84,12 @@ function additionalCompilerFlags(product, includePaths, frameworkPaths, systemIn throw ("The product's type must be in {staticlibrary, dynamiclibrary, application}. But it is " + product.type + '.'); } var sysroot = ModUtils.moduleProperty(product, "sysroot") - if (sysroot) - args.push('--sysroot=' + sysroot) + if (sysroot) { + if (product.moduleProperty("qbs", "targetPlatform").indexOf('darwin') !== -1) + args.push('-isysroot', sysroot); + else + args.push('--sysroot=' + sysroot); + } var i; var cppFlags = ModUtils.moduleProperties(input, 'cppFlags'); for (i in cppFlags) diff --git a/share/qbs/modules/qbs/common.qbs b/share/qbs/modules/qbs/common.qbs index 95b069876..3410e4119 100644 --- a/share/qbs/modules/qbs/common.qbs +++ b/share/qbs/modules/qbs/common.qbs @@ -16,7 +16,7 @@ Module { platforms.push("unix"); else if (targetOS === "android") platforms.push("linux", "unix"); - else if (targetOS === "mac") + else if (targetOS === "mac" || targetOS === "ios") platforms.push("darwin", "unix"); return platforms } |