diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2019-01-23 12:14:44 +0300 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2019-01-23 16:52:14 +0000 |
commit | c60b8ba4d4a61f5f2ca60b45e021bbdd43b73fce (patch) | |
tree | 0429bc884d82ac5b8cf98abefef56d8985b540fe /share | |
parent | 133901f4658caaa2bce042e33e38914682fa4043 (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')
-rw-r--r-- | share/qbs/imports/qbs/Probes/IarProbe.qbs | 4 | ||||
-rw-r--r-- | share/qbs/modules/cpp/iar.js | 10 | ||||
-rw-r--r-- | share/qbs/modules/cpp/iar.qbs | 16 |
3 files changed, 30 insertions, 0 deletions
diff --git a/share/qbs/imports/qbs/Probes/IarProbe.qbs b/share/qbs/imports/qbs/Probes/IarProbe.qbs index 20cbf3492..66b95162b 100644 --- a/share/qbs/imports/qbs/Probes/IarProbe.qbs +++ b/share/qbs/imports/qbs/Probes/IarProbe.qbs @@ -65,6 +65,10 @@ PathProbe { versionMajor = parseInt(version / 100); versionMinor = parseInt(version % 100); versionPatch = 0; + } else if (architecture === "avr") { + versionMajor = parseInt(version / 100); + versionMinor = parseInt(version % 100); + versionPatch = 0; } found = version && architecture && endianness; 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) { diff --git a/share/qbs/modules/cpp/iar.qbs b/share/qbs/modules/cpp/iar.qbs index df5218838..f7536fd07 100644 --- a/share/qbs/modules/cpp/iar.qbs +++ b/share/qbs/modules/cpp/iar.qbs @@ -82,6 +82,8 @@ CppModule { return "iccarm" + compilerExtension; case "mcs51": return "icc8051" + compilerExtension; + case "avr": + return "iccavr" + compilerExtension; } } compilerPath: FileInfo.joinPaths(toolchainInstallPath, compilerName) @@ -92,6 +94,8 @@ CppModule { return "iasmarm" + compilerExtension; case "mcs51": return "a8051" + compilerExtension; + case "avr": + return "aavr" + compilerExtension; } } assemblerPath: FileInfo.joinPaths(toolchainInstallPath, assemblerName) @@ -102,6 +106,8 @@ CppModule { return "ilinkarm" + compilerExtension; case "mcs51": return "xlink" + compilerExtension; + case "avr": + return "xlink" + compilerExtension; } } linkerPath: FileInfo.joinPaths(toolchainInstallPath, linkerName) @@ -112,6 +118,8 @@ CppModule { return "iarchive" + compilerExtension; case "mcs51": return "xlib" + compilerExtension; + case "avr": + return "xlib" + compilerExtension; } } property string archiverPath: FileInfo.joinPaths(toolchainInstallPath, archiverName) @@ -124,6 +132,8 @@ CppModule { return ".a"; case "mcs51": return ".r51"; + case "avr": + return ".r90"; } } @@ -133,6 +143,8 @@ CppModule { return ".out"; case "mcs51": return qbs.debugInformation ? ".d51" : ".a51"; + case "avr": + return qbs.debugInformation ? ".d90" : ".a90"; } } @@ -142,6 +154,8 @@ CppModule { return ".o"; case "mcs51": return ".r51"; + case "avr": + return ".r90"; } } @@ -151,6 +165,8 @@ CppModule { return "elf"; case "mcs51": return "ubrof"; + case "avr": + return "ubrof"; } } |