aboutsummaryrefslogtreecommitdiffstats
path: root/share/qbs/modules/cpp/iar.qbs
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2019-01-10 18:56:42 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2019-01-23 16:52:03 +0000
commit133901f4658caaa2bce042e33e38914682fa4043 (patch)
tree6b2b1cbc3d30c4a4da71f18b841f021e91f5cce2 /share/qbs/modules/cpp/iar.qbs
parentc2833b1a009bc7c382b30d94109b9b7a25a404a6 (diff)
bare-metal: Add IAR 8051 toolchain support
This commit adds a basic support of the IAR Embedded Workbench toolchain for the 8051 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 8051 v10.10.1 on Windows using the simple projects samples which are comes with the default IAR installer. Change-Id: I5ef1cc047c27a7fce4a6841331a67e8dd0f0453e Reviewed-by: Richard Weickelt <richard@weickelt.de> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'share/qbs/modules/cpp/iar.qbs')
-rw-r--r--share/qbs/modules/cpp/iar.qbs61
1 files changed, 56 insertions, 5 deletions
diff --git a/share/qbs/modules/cpp/iar.qbs b/share/qbs/modules/cpp/iar.qbs
index b91bd6022..df5218838 100644
--- a/share/qbs/modules/cpp/iar.qbs
+++ b/share/qbs/modules/cpp/iar.qbs
@@ -80,6 +80,8 @@ CppModule {
switch (qbs.architecture) {
case "arm":
return "iccarm" + compilerExtension;
+ case "mcs51":
+ return "icc8051" + compilerExtension;
}
}
compilerPath: FileInfo.joinPaths(toolchainInstallPath, compilerName)
@@ -88,6 +90,8 @@ CppModule {
switch (qbs.architecture) {
case "arm":
return "iasmarm" + compilerExtension;
+ case "mcs51":
+ return "a8051" + compilerExtension;
}
}
assemblerPath: FileInfo.joinPaths(toolchainInstallPath, assemblerName)
@@ -96,6 +100,8 @@ CppModule {
switch (qbs.architecture) {
case "arm":
return "ilinkarm" + compilerExtension;
+ case "mcs51":
+ return "xlink" + compilerExtension;
}
}
linkerPath: FileInfo.joinPaths(toolchainInstallPath, linkerName)
@@ -104,14 +110,50 @@ CppModule {
switch (qbs.architecture) {
case "arm":
return "iarchive" + compilerExtension;
+ case "mcs51":
+ return "xlib" + compilerExtension;
}
}
property string archiverPath: FileInfo.joinPaths(toolchainInstallPath, archiverName)
runtimeLibrary: "static"
- staticLibrarySuffix: ".a"
- executableSuffix: ".out"
- imageFormat: "elf"
+
+ staticLibrarySuffix: {
+ switch (qbs.architecture) {
+ case "arm":
+ return ".a";
+ case "mcs51":
+ return ".r51";
+ }
+ }
+
+ executableSuffix: {
+ switch (qbs.architecture) {
+ case "arm":
+ return ".out";
+ case "mcs51":
+ return qbs.debugInformation ? ".d51" : ".a51";
+ }
+ }
+
+ property string objectSuffix: {
+ switch (qbs.architecture) {
+ case "arm":
+ return ".o";
+ case "mcs51":
+ return ".r51";
+ }
+ }
+
+ imageFormat: {
+ switch (qbs.architecture) {
+ case "arm":
+ return "elf";
+ case "mcs51":
+ return "ubrof";
+ }
+ }
+
enableExceptions: false
enableRtti: false
@@ -121,17 +163,25 @@ CppModule {
Artifact {
fileTags: ["obj"]
- filePath: Utilities.getHash(input.baseDir) + "/" + input.fileName + ".o"
+ filePath: Utilities.getHash(input.baseDir) + "/"
+ + input.fileName + input.cpp.objectSuffix
}
prepare: IAR.prepareAssembler.apply(IAR, arguments);
}
FileTagger {
+ condition: qbs.architecture === "arm";
patterns: "*.s"
fileTags: ["asm"]
}
+ FileTagger {
+ condition: qbs.architecture === "mcs51";
+ patterns: ["*.s51", "*.asm"]
+ fileTags: ["asm"]
+ }
+
Rule {
id: compiler
inputs: ["cpp", "c"]
@@ -139,7 +189,8 @@ CppModule {
Artifact {
fileTags: ["obj"]
- filePath: Utilities.getHash(input.baseDir) + "/" + input.fileName + ".o"
+ filePath: Utilities.getHash(input.baseDir) + "/"
+ + input.fileName + input.cpp.objectSuffix
}
prepare: IAR.prepareCompiler.apply(IAR, arguments);