diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2019-08-13 18:28:19 +0300 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2019-08-15 14:03:10 +0000 |
commit | 2ae6989a8605f9be15defd294f2726b01bd5f093 (patch) | |
tree | abc8d11fe53e6d362ded379c1ecd42b226ad7093 /share/qbs/modules/cpp/iar.js | |
parent | 45cde14ce2b04cace352b0f59a80f4d30955d1e0 (diff) |
baremetal: Add IAR MSP430 toolchain support
This commit adds a basic support of the IAR Embedded Workbench
toolchain for the MSP430 processors family.
To use it with Qt Creator, it is enough to add there a desired Kit
with a custom IAR C/C++ compiler, and then set the following in the
Kit's Qbs profile settings:
* Key: qbs.toolchainType
* Value: iar
Tested with EW for MSP430 v7.12.4 on Windows using the simple
projects samples which come with the default IAR installer.
Change-Id: I6a31da1823fd08ba7bf41a315ac20e98f5ba77f6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'share/qbs/modules/cpp/iar.js')
-rw-r--r-- | share/qbs/modules/cpp/iar.js | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/share/qbs/modules/cpp/iar.js b/share/qbs/modules/cpp/iar.js index 023866701..105b876cb 100644 --- a/share/qbs/modules/cpp/iar.js +++ b/share/qbs/modules/cpp/iar.js @@ -49,6 +49,8 @@ function guessArchitecture(macros) return "avr"; else if (macros["__ICCSTM8__"] === "1") return "stm8"; + else if (macros["__ICC430__"] === "1") + return "msp430"; } function guessEndianness(macros) @@ -63,8 +65,10 @@ function cppLanguageOption(compilerFilePath) var baseName = FileInfo.baseName(compilerFilePath); if (baseName === "iccarm") return "--c++"; - if (baseName === "icc8051" || baseName === "iccavr" || baseName === "iccstm8") + if (baseName === "icc8051" || baseName === "iccavr" + || baseName === "iccstm8" || baseName === "icc430") { return "--ec++"; + } throw "Unable to deduce C++ language option for unsupported compiler: '" + FileInfo.toNativeSeparators(compilerFilePath) + "'"; } @@ -252,6 +256,8 @@ function compilerFlags(project, product, input, output, explicitlyDependsOn) { args.push("--ec++"); } else if (input.qbs.architecture === "stm8") { args.push("--ec++"); + } else if (input.qbs.architecture === "msp430") { + args.push("--ec++"); } } @@ -354,6 +360,8 @@ function linkerFlags(project, product, input, outputs) { args.push("-l", outputs.map_file[0].filePath); else if (product.qbs.architecture === "stm8") args.push("--map", outputs.map_file[0].filePath); + else if (product.qbs.architecture === "msp430") + args.push("-l", outputs.map_file[0].filePath); } var allLibraryPaths = []; @@ -374,6 +382,8 @@ function linkerFlags(project, product, input, outputs) { args.push("-rt"); else if (product.qbs.architecture === "avr") args.push("-rt"); + else if (product.qbs.architecture === "msp430") + args.push("-rt"); } var linkerScripts = inputs.linkerscript @@ -387,6 +397,8 @@ function linkerFlags(project, product, input, outputs) { args.push("-f", linkerScripts[i]); else if (product.qbs.architecture === "stm8") args.push("--config", linkerScripts[i]); + else if (product.qbs.architecture === "msp430") + args.push("-f", linkerScripts[i]); } if (product.cpp.entryPoint) { @@ -398,16 +410,21 @@ function linkerFlags(project, product, input, outputs) { args.push("-s", product.cpp.entryPoint); else if (product.qbs.architecture === "stm8") args.push("--entry", product.cpp.entryPoint); + else if (product.qbs.architecture === "msp430") + args.push("-s", product.cpp.entryPoint); } + // Silent operation. if (product.qbs.architecture === "arm") - args.push("--silent"); // Silent operation. + args.push("--silent"); else if (product.qbs.architecture === "mcs51") - args.push("-S"); // Silent operation. + args.push("-S"); else if (product.qbs.architecture === "avr") - args.push("-S"); // Silent operation. + args.push("-S"); else if (product.qbs.architecture === "stm8") - args.push("--silent"); // Silent operation. + args.push("--silent"); + else if (product.qbs.architecture === "msp430") + args.push("-S"); args = args.concat(ModUtils.moduleProperty(product, "driverLinkerFlags")); return args; |