aboutsummaryrefslogtreecommitdiffstats
path: root/share/qbs/modules/cpp/gcc.js
diff options
context:
space:
mode:
Diffstat (limited to 'share/qbs/modules/cpp/gcc.js')
-rw-r--r--share/qbs/modules/cpp/gcc.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/share/qbs/modules/cpp/gcc.js b/share/qbs/modules/cpp/gcc.js
index dfecfaac2..7b0380dbb 100644
--- a/share/qbs/modules/cpp/gcc.js
+++ b/share/qbs/modules/cpp/gcc.js
@@ -115,9 +115,10 @@ function linkerFlags(product, inputs, output) {
args = args.concat(escapeLinkerFlags(product, ["--as-needed"]));
}
- var arch = product.moduleProperty("cpp", "targetArch");
- if (isDarwin)
- args.push("-arch", arch);
+ if (haveTargetOption(product))
+ args.push("-target", product.moduleProperty("cpp", "target"));
+ else if (isDarwin)
+ args.push("-arch", product.moduleProperty("cpp", "targetArch"));
var minimumDarwinVersion = ModUtils.moduleProperty(product, "minimumDarwinVersion");
if (minimumDarwinVersion) {