diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2019-07-26 16:57:44 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2019-07-26 16:57:44 +0200 |
commit | d46b40d27ebc9bcbdb4430893396f066e1f2d758 (patch) | |
tree | 28f269505091363139945284ec77dd2636a12290 /share/qbs/modules/cpp/iar.js | |
parent | 7ead994c8a3e263c4cced6f54f0d959d32268454 (diff) | |
parent | 2269ddc60e47bfea459ef034ab1be112716b4764 (diff) |
Merge 1.14 into master
Change-Id: Ic632b377bf10e2b320956011e9a7d4eea99f560b
Diffstat (limited to 'share/qbs/modules/cpp/iar.js')
-rw-r--r-- | share/qbs/modules/cpp/iar.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/share/qbs/modules/cpp/iar.js b/share/qbs/modules/cpp/iar.js index 60cb72343..ddaa00e2d 100644 --- a/share/qbs/modules/cpp/iar.js +++ b/share/qbs/modules/cpp/iar.js @@ -58,6 +58,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"); @@ -66,7 +77,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); @@ -86,7 +97,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 |