aboutsummaryrefslogtreecommitdiffstats
path: root/share/qbs/modules/cpp/iar.js
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2019-01-23 12:14:44 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2019-01-23 16:52:14 +0000
commitc60b8ba4d4a61f5f2ca60b45e021bbdd43b73fce (patch)
tree0429bc884d82ac5b8cf98abefef56d8985b540fe /share/qbs/modules/cpp/iar.js
parent133901f4658caaa2bce042e33e38914682fa4043 (diff)
bare-metal: Add IAR AVR toolchain support
This commit adds a basic support of the IAR Embedded Workbench toolchain for the AVR 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 AVR v7.20.1 on Windows using the simple projects samples which are comes with the default IAR installer. Change-Id: I4ba65e0a753f8703764551c62d630849ff86d91f Reviewed-by: Richard Weickelt <richard@weickelt.de> 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.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/share/qbs/modules/cpp/iar.js b/share/qbs/modules/cpp/iar.js
index 5b358b332..a373fac8e 100644
--- a/share/qbs/modules/cpp/iar.js
+++ b/share/qbs/modules/cpp/iar.js
@@ -45,6 +45,8 @@ function guessArchitecture(macros)
return "arm";
else if (macros["__ICC8051__"] === "1")
return "mcs51";
+ else if (macros["__ICCAVR__"] === "1")
+ return "avr";
}
function guessEndianness(macros)
@@ -184,6 +186,8 @@ function compilerFlags(project, product, input, output, explicitlyDependsOn) {
args.push("--no_rtti");
} else if (input.qbs.architecture === "mcs51") {
args.push("--ec++");
+ } else if (input.qbs.architecture === "avr") {
+ args.push("--ec++");
}
}
@@ -269,6 +273,8 @@ function linkerFlags(project, product, input, outputs) {
args.push("--map", outputs.map_file[0].filePath);
else if (product.qbs.architecture === "mcs51")
args.push("-l", outputs.map_file[0].filePath);
+ else if (product.qbs.architecture === "avr")
+ args.push("-l", outputs.map_file[0].filePath);
}
var allLibraryPaths = [];
@@ -287,6 +293,8 @@ function linkerFlags(project, product, input, outputs) {
if (product.cpp.debugInformation) {
if (product.qbs.architecture === "mcs51")
args.push("-rt");
+ else if (product.qbs.architecture === "avr")
+ args.push("-rt");
}
var linkerScripts = inputs.linkerscript
@@ -296,6 +304,8 @@ function linkerFlags(project, product, input, outputs) {
args.push("--config", linkerScripts[i]);
else if (product.qbs.architecture === "mcs51")
args.push("-f", linkerScripts[i]);
+ else if (product.qbs.architecture === "avr")
+ args.push("-f", linkerScripts[i]);
}
if (product.cpp.entryPoint) {