diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2021-06-08 18:02:23 +0300 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2021-06-13 22:32:03 +0000 |
commit | aa859910f956161e1a4bc8b9b5012c2335bf5eca (patch) | |
tree | fa45d98e4c7b5ad8d8b1256b0b0117c4f4d56a77 /share/qbs/modules/cpp/sdcc.js | |
parent | f0a39bab91c7ea823dcfb645c0b7f934d3f4fcdf (diff) |
baremetal: Introduce new toolchainDetails property
.. to reduce the number of if/else conditions and to simplify the code.
Change-Id: Id4e6574b719986d3fc7f8b27106a60b00cbd67ea
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Diffstat (limited to 'share/qbs/modules/cpp/sdcc.js')
-rw-r--r-- | share/qbs/modules/cpp/sdcc.js | 44 |
1 files changed, 17 insertions, 27 deletions
diff --git a/share/qbs/modules/cpp/sdcc.js b/share/qbs/modules/cpp/sdcc.js index 1c99b902c..fe9406baa 100644 --- a/share/qbs/modules/cpp/sdcc.js +++ b/share/qbs/modules/cpp/sdcc.js @@ -41,36 +41,26 @@ var TextFile = require("qbs.TextFile"); var Utilities = require("qbs.Utilities"); var WindowsUtils = require("qbs.WindowsUtils"); -function compilerName(qbs) { - return "sdcc"; -} - -function assemblerName(qbs) { - switch (qbs.architecture) { - case "mcs51": - return "sdas8051"; - case "stm8": - return "sdasstm8"; - case "hcs8": - return "sdas6808"; - } -} - -function linkerName(qbs) { - switch (qbs.architecture) { - case "mcs51": - return "sdld"; - case "stm8": - return "sdldstm8"; - case "hcs8": - return "sdld6808"; +function toolchainDetails(qbs) { + var architecture = qbs.architecture; + if (architecture === "mcs51") { + return { + "assemblerName": "sdas8051", + "linkerName": "sdld" + } + } else if (architecture === "stm8") { + return { + "assemblerName": "sdasstm8", + "linkerName": "sdldstm8" + } + } else if (architecture === "hcs8") { + return { + "assemblerName": "sdas6808", + "linkerName": "sdld6808" + } } } -function archiverName(qbs) { - return "sdar"; -} - function targetArchitectureFlag(architecture) { if (architecture === "mcs51") return "-mmcs51"; |