diff options
author | Jake Petroules <jake.petroules@petroules.com> | 2013-12-04 17:44:18 -0500 |
---|---|---|
committer | Jake Petroules <jake.petroules@petroules.com> | 2013-12-05 18:52:30 +0100 |
commit | 0d97f0b4923179c7ac1af148c57779a7ad9ed055 (patch) | |
tree | 45d8bdfda4fad3fc46abb48df2d4b238a4103292 | |
parent | 2ea6832ef470963e9c34772f61702394f5951ea4 (diff) |
Use -arch instead of -m32/-m64 when using LLVM toolchains.
This fixes building for iOS targets or any other non-x86 architectures,
with LLVM/Clang.
Change-Id: I8af3745080c6e678351dd7a117665fb9a8231bee
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
-rw-r--r-- | share/qbs/modules/cpp/gcc.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/share/qbs/modules/cpp/gcc.js b/share/qbs/modules/cpp/gcc.js index 6dc75a041..792e8a321 100644 --- a/share/qbs/modules/cpp/gcc.js +++ b/share/qbs/modules/cpp/gcc.js @@ -89,10 +89,16 @@ function configFlags(config) { var args = []; var arch = ModUtils.moduleProperty(config, "architecture") - if (arch === 'x86_64') - args.push('-m64'); - else if (arch === 'x86') - args.push('-m32'); + if (config.moduleProperty("qbs", "toolchain").contains("llvm") && + config.moduleProperty("qbs", "targetOS").contains("darwin")) { + args.push("-arch"); + args.push(arch === "x86" ? "i386" : arch); + } else { + if (arch === 'x86_64') + args.push('-m64'); + else if (arch === 'x86') + args.push('-m32'); + } if (ModUtils.moduleProperty(config, "debugInformation")) args.push('-g'); |