aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--share/qbs/modules/cpp/iar.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/share/qbs/modules/cpp/iar.js b/share/qbs/modules/cpp/iar.js
index 3098c88f6..33093c0a3 100644
--- a/share/qbs/modules/cpp/iar.js
+++ b/share/qbs/modules/cpp/iar.js
@@ -56,6 +56,17 @@ function guessEndianness(macros)
return "big"
}
+function cppLanguageOption(compilerFilePath)
+{
+ var baseName = FileInfo.baseName(compilerFilePath);
+ if (baseName === "iccarm")
+ return "--c++";
+ if (baseName === "icc8051" || baseName === "iccavr")
+ return "--ec++";
+ throw "Unable to deduce C++ language option for unsupported compiler: '"
+ + FileInfo.toNativeSeparators(compilerFilePath) + "'";
+}
+
function dumpMacros(compilerFilePath, tag) {
var tempDir = new TemporaryDir();
var inFilePath = FileInfo.fromNativeSeparators(tempDir.path() + "/empty-source.c");
@@ -64,7 +75,7 @@ function dumpMacros(compilerFilePath, tag) {
var args = [ inFilePath, "--predef_macros", outFilePath ];
if (tag && tag === "cpp")
- args.push("--c++");
+ args.push(cppLanguageOption(compilerFilePath));
var p = new Process();
p.exec(compilerFilePath, args, true);
@@ -84,7 +95,7 @@ function dumpDefaultPaths(compilerFilePath, tag) {
var args = [ inFilePath, "--preinclude", "." ];
if (tag === "cpp")
- args.push("--c++");
+ args.push(cppLanguageOption(compilerFilePath));
var p = new Process();
// This process should return an error, don't throw