aboutsummaryrefslogtreecommitdiffstats
path: root/share/qbs/modules/cpp
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@digia.com>2014-07-08 15:06:18 +0200
committerChristian Kandeler <christian.kandeler@digia.com>2014-07-14 18:12:54 +0200
commitecc03e2e54a94562df750e571fc1058d012e0f57 (patch)
treed397a08edf7253a8f903df6a4d80417aca491396 /share/qbs/modules/cpp
parent88848889797dfe08119d35c573d3ea1691127129 (diff)
introduce cpp.compilerPathByLanguage
The setup-toolchains tool stores the compiler path per language in compilerPathByLanguage for toolchains that provide different compiler binaries for different languages. For the gcc/clang toolchains we now use g++/clang++ for C++ and gcc/clang for everything else. Change-Id: I62ce5a5a4217e2832fafd03301ff75efab62a608 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Diffstat (limited to 'share/qbs/modules/cpp')
-rw-r--r--share/qbs/modules/cpp/CppModule.qbs1
-rw-r--r--share/qbs/modules/cpp/gcc.js10
2 files changed, 10 insertions, 1 deletions
diff --git a/share/qbs/modules/cpp/CppModule.qbs b/share/qbs/modules/cpp/CppModule.qbs
index 394568238..5271c6fa9 100644
--- a/share/qbs/modules/cpp/CppModule.qbs
+++ b/share/qbs/modules/cpp/CppModule.qbs
@@ -85,6 +85,7 @@ Module {
property pathList linkerScripts
property string compilerName
property string compilerPath: compilerName
+ property var compilerPathByLanguage
property stringList compilerWrapper
property string linkerName
property string linkerPath: linkerName
diff --git a/share/qbs/modules/cpp/gcc.js b/share/qbs/modules/cpp/gcc.js
index 232d27bc7..b01a4bb0e 100644
--- a/share/qbs/modules/cpp/gcc.js
+++ b/share/qbs/modules/cpp/gcc.js
@@ -292,7 +292,15 @@ function prepareCompiler(project, product, inputs, outputs, input, output) {
args = args.concat(additionalCompilerFlags(product, input, output));
args = args.concat(additionalCompilerAndLinkerFlags(product));
- var compilerPath = ModUtils.moduleProperty(product, "compilerPath");
+ var compilerPath;
+ var compilerPathByLanguage = ModUtils.moduleProperty(product, "compilerPathByLanguage");
+ if (compilerPathByLanguage)
+ compilerPath = compilerPathByLanguage[tag];
+ if (!compilerPath) {
+ // fall back to main compiler
+ compilerPath = ModUtils.moduleProperty(product, "compilerPath");
+ }
+
var wrapperArgs = ModUtils.moduleProperty(product, "compilerWrapper");
if (wrapperArgs && wrapperArgs.length > 0) {
args.unshift(compilerPath);