aboutsummaryrefslogtreecommitdiffstats
path: root/share/qbs/modules/cpp/iar.qbs
Commit message (Collapse)AuthorAgeFilesLines
* Prefer built-in JS function in modulesChristian Kandeler2023-02-201-1/+1
| | | | | | | contains -> includes Change-Id: Id893c2ea0659d9bded4f5cec1a3160ccd802118b Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Remove `import qbs` from all project filesDenis Shienkov2021-08-041-1/+0
| | | | | | | | | | | | | | ... because we don't need in this inclusion at all. But for some cases it is impossible to remove that inclusions (and even to move on next lines) because then the some tests are failed by unknown reason. For those tests were added the following comments on the inclusion lines: `// FIXME: Don't remove this import because then the test fails!` Change-Id: I9153fd0e38b94af08168e499ee46a23889ee4d73 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Separate Cpp.{assembler|compiler}Output{Tags|Artifacts}Denis Shienkov2021-06-291-3/+3
| | | | | | | | | We need to separate the functionality of these functions, since their content will differ in the future (for example, the 'intermediate_obj' tag will be added for the compiler). Change-Id: Ife65aed95966b92a3646d73512a0a0add4cd1aac Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Make property cpp.compilerExtension as sharedDenis Shienkov2021-06-141-2/+0
| | | | | | | | It makes sense to share the cpp.compilerExtension property, because this property is used in almost all CPP modules. Change-Id: I0bf44a83c722772b93d7f2febbef7b4e38d11103 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* baremetal: Introduce new toolchainDetails propertyDenis Shienkov2021-06-131-10/+16
| | | | | | | .. to reduce the number of if/else conditions and to simplify the code. Change-Id: Id4e6574b719986d3fc7f8b27106a60b00cbd67ea Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* baremetal: Implement validate script in CPP toolchain modulesDenis Shienkov2021-06-071-0/+4
| | | | | | | | It makes sense to check the architecture inside of the 'validate' script in the module; and then we can throw an error only once. Change-Id: I17821404ad854e38bafc70f1ca6904c33c48147f Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Use separate functions for repetitive actionsDenis Shienkov2021-05-251-0/+8
| | | | | | | | | It makes sense to minimize the copy-paste errors by moving the repetitive code into the separate functions to the cpp.js file. This will simplify the code and improve the maintenance. Change-Id: Id5a2914ff28619553b855cc6f09810ad370c408c Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* baremetal: Move cpp-specific JS functions to cpp.js fileDenis Shienkov2021-05-191-9/+9
| | | | | | | | | Previous commit 79b9b02 added these functions to the ModUtils module, but seems a best place for these functions is cpp.js file. Change-Id: Id89b88e1865d003c1c7811220ed01f6d6becfba3 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* baremetal: Share generation of generic lists of tags and artifactsDenis Shienkov2021-05-141-8/+8
| | | | | | | | | | | It makes sense to put in separate functions the repeating code for generating a list of tags and artifacts for compilation and linking. The generic code has been moved into the ModUtils module, which simplifies maintenance and minimizes copy-paste errors. Change-Id: I28b8e5467cf6a6764cbe7b1b7b68797b1d6ec1f4 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix conditionally generation for some artifacts and tagsDenis Shienkov2021-05-061-3/+3
| | | | | | | | | | | | We need to generate a list of file tags and artifacts taking into account the dependent properties from the product. For example, we should only build tags for generating linker files if the generateLinkerMapFile property has been set. Change-Id: I286c566ffe119eebf24b60113dda65403f7af3dd Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Share cpp::{assembler|compiler}ListingSuffix propertiesDenis Shienkov2021-04-061-4/+2
| | | | | | | | | | | | | | | | It makes sense to add the cpp.assemblerListingSuffix and the cpp.compilerListingSuffix properties to the base CppModule due the following reasons: 1. It is possible that the user wants to change the extension for the generated listing files, which makes working with Qbs more flexible. 2. It will be easier to write an autotests that check the generation of the listing files for a bare metal platforms, where listing files can have various extensions such as ".lst", ".ls", and so forth. Change-Id: I9989288bff0659dd3e8b7a443d0354bb78475270 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Share cpp::objectSuffix propertyDenis Shienkov2021-03-301-2/+1
| | | | | | | | | | | | | | | It makes sense to add the cpp.objectSuffix property to the base CppModule due the following reasons: 1. It is possible that the user wants to change the extension for the generated object files, which makes working with Qbs more flexible. 2. It will be easier to write an autotests that check the generation of the object files for a bare metal platforms, where object files can have various extensions such as ".rel", ".r90", ".r43", and so forth. Change-Id: Ib73836d5e614a6924d312d061f02437c3b318785 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Make `cpp.toolchainInstallPath` property as public for toolchainsDenis Shienkov2020-12-021-2/+1
| | | | | | | | This property re-declared in each of toolchain modules. So, it makes sense to declare this property once in a base CppModule. Change-Id: I1df76b288660d4b999c918a0019a01825ee0890a Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* baremetal: Introduce new 'none' choosing for qbs.targetPlatformDenis Shienkov2020-08-041-0/+1
| | | | | | | | | | | | | | | | | This 'none' value should be used for a bare-metal toolchains in the qbs.targetPlatform and the qbs.targetOS properties. Now this value is set in the profiles during automatic detection of such toolchains as IAR, KEIL and SDCC. Take into account, that it is impossible to do the same and for the GCC toolchain, because there are not exists a proper way to know that a current GCC is for a 'bare-metal'. So, the users should change the qbs.targetPlatform manually. Change-Id: I178fd526bbb5ae44f18e35ff12970ed0718c476d Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* baremetal: Introduce new cpp::generate{Assembler|Compiler}ListingFilesDenis Shienkov2019-10-171-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Improve artifact creation code for IAR EW moduleDenis Shienkov2019-10-111-48/+8
| | | | | | | ... to move this code to a separate helper functions. Change-Id: I56678be39df931105b04bec1340aa7ba09e523d9 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: Fix IAR assembler file tagsDenis Shienkov2019-08-191-8/+1
| | | | | | | | | | | | | | | | The IAR EW IDE provides the following file patterns [*.s*, *.msa, *.asm] for the assembler files. So, we will use same patterns too. But, instead of '*.s*' pattern we will use a set of the following patterns: '*.s' - for ARM and/or STM8 architectures. '*.s43' - for MSP430 architecture. '*.s51' - for 8051 architecture. '*.s90' - for AVR architecture. Change-Id: I5aad9ee7a81325e65be18d0ae0e0c1c9a9f6cf27 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* baremetal: Improve JS code in IAR module a bitDenis Shienkov2019-08-191-117/+12
| | | | | | | | | | | | * Move an architecture-specific code to a functions in the iar.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> Change-Id: Ibfdc536f78d1145f6e1190da33f67b0fb7063f05 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Richard Weickelt <richard@weickelt.de>
* baremetal: Add IAR MSP430 toolchain supportDenis Shienkov2019-08-151-0/+16
| | | | | | | | | | | | | | | | | | This commit adds a basic support of the IAR Embedded Workbench toolchain for the MSP430 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 MSP430 v7.12.4 on Windows using the simple projects samples which come with the default IAR installer. Change-Id: I6a31da1823fd08ba7bf41a315ac20e98f5ba77f6 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* bare-metal: Add IAR STM8 toolchain supportDenis Shienkov2019-07-261-1/+17
| | | | | | | | | | | | | | | | | | | This commit adds a basic support of the IAR Embedded Workbench toolchain for the STM8 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 STM8 v3.11.1 on Windows using the simple projects samples which come with the default IAR installer. Change-Id: Ibc116ceb33b7df49c3241d26fa97136255ba06dd Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* bare-metal: Implement cpp.compilerIncludePaths for IAR toolchainDenis Shienkov2019-05-101-0/+1
| | | | | Change-Id: I3b8a3607e1e5c252731dea783acd9c1a0867a127 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* bare-metal: Implement cpp.compilerDefinesByLanguage for IAR toolchainDenis Shienkov2019-05-101-1/+2
| | | | | | Change-Id: Id18528b1f6f6a98bec3f877e70c660180078a66c Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix some missed license headersDenis Shienkov2019-02-131-1/+1
| | | | | Change-Id: I98570fb463bf856a6b6ab2b39fa2bca27b8c0500 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* bare-metal: Add IAR AVR toolchain supportDenis Shienkov2019-01-231-0/+16
| | | | | | | | | | | | | | | | | | | 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>
* bare-metal: Add IAR 8051 toolchain supportDenis Shienkov2019-01-231-5/+56
| | | | | | | | | | | | | | | | | | | 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>
* bare-metal: Link with library dependencies on IAR for ARMDenis Shienkov2019-01-211-0/+2
| | | | | | | | | | | | | | This patch adds the possibility to link the application with an external or dependent libraries. IAR supports linking only with the static libraries for the bare-metal devices. Now it is possible to use the cpp.staticLibraries and cpp.libraryPaths properties, also to use the product's library dependencies via Depends { name: "mylib" }. Change-Id: I5129473dc0353970d060a8c714b2f4b51d1ab4cc Reviewed-by: Richard Weickelt <richard@weickelt.de> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* bare-metal: Add IAR EWARM toolchain support on WindowsDenis Shienkov2019-01-191-0/+195
This commit adds a basic support of the IAR Embedded Workbench toolchain for the ARM processors on Windows host. 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 To specify the target CPU/FPU you need to set the cpp.driverFlags property, like this: cpp.driverFlags: [ "--cpu", "Cortex-M4", "--fpu", "VFPv4_sp" ] Then these flags will be automatically passed to both compiler and assembler. To specify the linker flags you need to set the cpp.driverLinkerFlags property instead of cpp.linkerFlags property, like this: cpp.driverLinkerFlags: ["--vfe"] To add the linker script files you need to set the 'linkerscript' tag, e.g. in the following way: Group { name: "Linker scripts" fileTags: ["linkerscript"] files: ["stm32f407xx_flash.icf"] } Other properties can be used as usual, according to the EWARM compiler documentation. Tested with EWARM v8.20.2, v6.50.3 on Windows using: * STM NUCLEO-F767ZI * STM 32F4DISCOVERY target boards. Change-Id: I3c42eb94051352cb3b7eb5b0768a1dc8bdacabce Reviewed-by: Richard Weickelt <richard@weickelt.de> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>