aboutsummaryrefslogtreecommitdiffstats
path: root/share/qbs/modules/cpp/sdcc.qbs
Commit message (Collapse)AuthorAgeFilesLines
* baremetal: Introduce new cpp::generate{Assembler|Compiler}ListingFilesDenis Shienkov2019-10-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This properties enables or disables generation of a compiler or assembler listing files. Reason why we need in this property is in that some compilers (e.g. KEIL C51) generates a listing files by default, that spams a project sources directory. So, we need to have a possibility e.g. to disable it or to generate to an output directory. This patch implements this feature for KEIL, IAR, SDCC compilers with the following restrictions: * IAR (8051, AVR, STM8, MSP430, ARM) - full support. * KEIL (8051) - full support. * KEIL (ARM) - has only one restriction in that a compiler does not support specifying of an output listing file name. It is possible to specify only an output listing directory. So, a listing file names will be a bit different than for other compilers (e.g. if a source file name is 'foo.c', then the listing file name will be 'foo.lst', instead of 'foo.c.lst'). * SDCC (8051, STM8) - seems, has not possibility to disable an auto-generated listing files. But it generates an output listing files to a right output directory with the object files. Besides, a listing files has a correct names (e.g. for the 'foo.c' file, the listing file will be 'foo.c.lst'). Change-Id: Ic3516101e69eed156cf71606a7144efc72d40204 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* baremetal: Fix merging issues from 1.14 to masterDenis Shienkov2019-10-101-8/+3
| | | | | Change-Id: Id859d95ddfb776ec534ba0e46d989bb2ba30770a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Merge 1.14 into masterChristian Kandeler2019-10-081-47/+10
|\ | | | | | | Change-Id: Ief78bb9d82344e31135faca42a422c23951e87ec
| * baremetal: Add missed output artifacts for SDCC compilerDenis Shienkov2019-10-011-53/+11
| | | | | | | | | | | | | | | | | | | | Compiler produces a lot of additional ".adb", ".lst", ".asm", ".sym", ".rst", ".lk", ".mem" files. This files should be also processed in SDCC module (e.g. it allows to remove this files by 'clean' command). Change-Id: Ib07dbe63ab27e263d67025ce5cd40a967910d354 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Refactor the map file generation propertyDenis Shienkov2019-10-011-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. It is makes sense to define this property once inside of CppModule, instead of duplicate it in each other module. 2. A new property name 'generateLinkerMapFile' will be better than a previous, so, we can rename this property. 3. The map file generation is not necessary to be always enabled, so, we can disable this property by default. Change-Id: I0439e8b3e0273593c8456d32b1c099ff09498fad Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | baremetal: Improve JS code in SDCC module a bitDenis Shienkov2019-08-191-22/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | * Move an architecture-specific code to a functions in the sdcc.js file. * Remove the redundant copy-paste code. * Align order for assembler, compiler, linker and archiver flags to the unified form, like: <inputs> <outputs> <defines> <includes> <flags> * Add some comments. * Fix handling of cLanguageVersion property. Change-Id: Id787b4455847ac5dde4a926d850e7c076edc34d2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | bare-metal: Fix SDCC toolchain moduleDenis Shienkov2019-07-291-24/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | * SDCC support only the '.lib' library suffix. * SDCC support only the '.rel' object suffix. * SDCC produce the 'ihx' default image format. Besides, SDCC expect same target flag for both compiler and linker. We automatically take this flag from the cpp.architecture property. Change-Id: If7eac1d5ddc0c571d3c6a870f46f78d61d699f12 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | bare-metal: Add STM8 architecture for SDCC toolchainDenis Shienkov2019-07-261-3/+28
|/ | | | | | | | | | | | | | | | Previous implementation of SDCC toolchain based on an assumption, that the default target architecture always is MCS51. But, the SDCC compiler support multiple architectures: * http://sdcc.sourceforge.net/ So, it is makes sense to add support and for STM8 architecture to the SDCC toolchain. Change-Id: Ibbd32764fe2fac3e45fda93ac3d903c3619efb18 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* bare-metal: Implement cpp.compilerDefinesByLanguage for SDCC toolchainDenis Shienkov2019-05-141-1/+1
| | | | | Change-Id: I934a7bf3679dfda15ef245a9d14e834dc5136861 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* bare-metal: Implement cpp.compilerIncludePaths for SDCC toolchainDenis Shienkov2019-05-141-0/+1
| | | | | Change-Id: If9143a5af10c842bbb2b6dd08d201f8d9963012f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* bare-metal: Use preferred architecture to dump macrosDenis Shienkov2019-05-141-0/+1
| | | | | | | | | | | | | | .. for SDCC toolchain. The SDCC compiler binary support multiple architectures (aka 8051, z80, and others). So, it is necessary to set a target architecture option before getting the macros. We will take a preferred target architecture from the qbs.architecture property. If this property initially is undefined, then will be returned macros for default compiler architecture (usually it is mcs51). Change-Id: I379ffe90895b62e2786c3ffba2da47b1864da75d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* bare-metal: Add SDCC toolchain supportDenis Shienkov2019-04-101-0/+203
This commit adds a basic support for the SDCC compiler: * http://sdcc.sourceforge.net/ As this compiler support multiple architectures, then it is impossible to uniquely identify the current architecture by dumping of the pre-defined macros (because its content depends on a target flag). In this case the cpp.architecture will contains a default architecture (which is dumped with an omitted target flag). To use it with Qt Creator, it is enough to add there a desired Kit with a custom SDCC C/C++ compiler, and then set the following in the Kit's Qbs profile settings: * Key: qbs.toolchainType * Value: sdcc To create the SDCC profile it is enougth to use the following command: qbs setup-toolchains --type sdcc <path/to/sdcc/compiler/binary> <profile name> A toolchain type can be omitted; in this case the QBS will tries to detect the toolchain type from the specified compiler name. Also it is possible to auto-detect the SDCC toolchain from the PATH environment using the following command: qbs setup-toolchain --detect At current time are supported only the 8051 (aka MCS51) architecture; other architectures can be added later. Change-Id: I8cc239d62e35472ab667e054a64a1e59c2d548bd Reviewed-by: Richard Weickelt <richard@weickelt.de> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>