summaryrefslogtreecommitdiff
path: root/share/qbs/modules/cpp/iar.js
Commit message (Collapse)AuthorAgeFilesLines
* Fix descriptions for JS commandsDenis Shienkov2021-11-151-1/+1
| | | | | | | | | | | * All descriptions start with a small letter. * Trailing dots have been removed from all descriptions. * For all static library rules replaced 'linking' with 'creating' in descriptions. * Added 'ing' ending to all descriptions where it was missing. Change-Id: I2a4cb9dd53980d33628e097efaae53a68573af42 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix usage of Cpp.collectMiscAssemblerArguments() functionDenis Shienkov2021-06-291-4/+1
| | | | | | | | * We need to pass the 'asm' tag for this function. * We need to use this function also in MSVC toolchain. Change-Id: I3dfc7b79ec17b855da76dab35428d875c39548a1 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* baremetal: Introduce new toolchainDetails propertyDenis Shienkov2021-06-131-162/+93
| | | | | | | .. 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-36/+0
| | | | | | | | 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-86/+83
| | | | | | | | | 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-2/+2
| | | | | | | | | 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-121/+1
| | | | | | | | | | | 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-11/+27
| | | | | | | | | | | | 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-3/+9
| | | | | | | | | | | | | | | | 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::linkerMapSuffix propertyDenis Shienkov2021-04-011-1/+1
| | | | | | | | | | | | | | | | It makes sense to add the cpp.linkerMapSuffix property to the base CppModule due the following reasons: 1. It is possible that the user wants to change the extension for the generated map files, which makes working with Qbs more flexible. 2. It will be easier to write an autotests that check the generation of the map files for a bare metal platforms, where object files can have various extensions such as ".map", ".m51", ".m66", and so forth. Change-Id: I1e5e3b39bf84fddfe8c06f2db9d3936c6a3ff027 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* baremetal: Report only existing compiler's include paths for IARDenis Shienkov2021-02-271-2/+3
| | | | | | | ... to pass the tests. Change-Id: I536a12d4da1634c8f4f02587c41e29750b64f8fc Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* baremetal: Fix typo in `--endian` option for IAR ARM or RX assemblerDenis Shienkov2021-02-271-1/+1
| | | | | | | We need to use `--endian <option>` instead of `--endian=<option>` Change-Id: Ic9f3a7d06491a99ca330cf7f40bab3bbf0ceb486 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Test for array-like objects with instanceof ArrayRichard Weickelt2021-02-151-1/+1
| | | | | | | | | | Array.isArray() seemed to work for arrays created in scripts as well as for QStringList and QVariantList created in C++ when using QtScript. QJSEngine is more strict (see the comments in QTBUG-45018). One way to work around that problem is to use instanceof Array instead. Change-Id: I0f1c8757a5ab2f82e26eff19a8b5ecf667bb04b1 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* baremetal: Improve detection of IAR compiler includesDenis Shienkov2021-02-021-27/+29
| | | | | | | | | | | | | | | | | | The IAR compiler has an undocumented command line option `--IDE3`, which allows you to print a list of compiler include paths as: `$$TOOL_BEGIN $$VERSION "3" $$INC_BEGIN $$FILEPATH "<path\\to\\directory>" $$TOOL_END` Besides, the same approach is used in the IAR extension for the VSCode IDE. So we can use this approach to implement it the Qbs module as well. In addition, this commit contains an autotest to check the `cpp.compilerIncludePaths` property. Change-Id: I434dd630913e5afd6cba5b4e31e1021ee0c5fe31 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* baremetal: Handle cpp.prefixHeaders property in IAR assemblerDenis Shienkov2021-01-291-1/+10
| | | | | | | | | | | We need to pass the `--preinclude` option and to the assembler too in case the `cpp.prefixHeaders` is not empty. One caveat is that this option is not supported on all architectures and we need to handle it properly. Change-Id: I31eda38a8f400a0534a43d141ee64aef405fa683 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* baremetal: Handle cpp.endianness property in IAR assemblerDenis Shienkov2021-01-291-0/+5
| | | | | | | | | The IAR assembler for ARM and RX architectures allows you to specify a target endiannes parameter. So we need to handle this use case as well. Change-Id: Ifa6c237fb2d4fc7de361290edcaa491bb23e3165 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* baremetal: Improve JS code in IAR toolchain moduleDenis Shienkov2021-01-291-171/+265
| | | | | | | | | | | | | | | | | | | This patch is a small refactoring in the cpp module for IAR, containing the following changes: 1. Alphabetical sorting by architectures and compiler names has been performed. 2. Some common logical parts are divided into separate functions. 3. Improved logic for checking compilers for supported options depending on the architecture. Also, the command line options of toolchains have been rechecked for all supported architectures. Change-Id: I5d274240682cb16c073d146ce47541d10783738f Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* baremetal: Add support for HCS08 architectures to IAR toolchainDenis Shienkov2021-01-261-5/+17
| | | | | | | | | | This patch adds the HCS08 architectures, provided by Freescale Semiconductor: * https://en.wikipedia.org/wiki/Motorola_S08 Change-Id: Idd668e30bfeb69e588b93b15131e741924b66f40 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* baremetal: Add support for HCS12 architectures to IAR toolchainDenis Shienkov2021-01-211-5/+14
| | | | | | | | | | This patch adds the HCS12 architectures, provided by Freescale Semiconductor: * https://en.wikipedia.org/wiki/Motorola_68HC12 Change-Id: I9083bac9997e0dec50e0392040ce63beaa8a8f05 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* baremetal: Fix dumping of compiler includes for IAR toolchainDenis Shienkov2020-11-181-6/+3
| | | | | Change-Id: I176db33bcd1ea270e890f8422d10bc5133c891bf Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* baremetal: Fix assignment of probes 'found' flagDenis Shienkov2020-09-041-4/+2
| | | | | | Change-Id: I532e06f6688c5ad32702cd3401ae4ef37200a23f Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Extract compiler macros using common JS functionDenis Shienkov2020-08-311-6/+1
| | | | | | | | It makes sense to unify the compiler macros extraction using a common JS function, instead of a JS code duplication. Change-Id: I9eb9e8df012ca6bae3a38101906a4c70e2fc38c4 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* baremetal: Fix typo in cpp.optimization flags for IAR toolchainDenis Shienkov2020-08-121-2/+2
| | | | | | | | | We need to use the '-Ohz' options for the small code size optimizations, and the '-Ohs' options for the fast code optimizations. Fixes: QBS-1590 Change-Id: Ia172d29d884acd2161e072d245ebb13b89650e33 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* baremetal: Use 'input' target instead of 'product' targetDenis Shienkov2020-08-081-2/+2
| | | | | | | | ... to get value of cpp.generate{Compiler|Assembler}ListingFiles properties. Change-Id: Iefd1401ac475a7937843a80af021668f0241a8c7 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* baremetal: Fix typos in input parameters for {linker|archiver} flagsDenis Shienkov2020-08-081-4/+4
| | | | | Change-Id: I7f88ab54dd3e8870b55bb3540250eb037d328206 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* baremetal: Pass all current tests for IAR M16CDenis Shienkov2020-07-271-1/+1
| | | | | | | | We need to exclude the '--deprecated_feature_warnings' flag for the IAR M16C compiler, because this flag is not supported. Change-Id: I48fbb99b5aa46f7a48857099d1cd55188e902ee3 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* baremetal: Fix typo in CR16 architecture detection macro for IARDenis Shienkov2020-07-271-1/+1
| | | | | | | This also passes all current tests for IAR CR16. Change-Id: I685526b3f215830cdc0cf77c7e231c451dd4ecdf Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* baremetal: Pass all current tests for IAR SHDenis Shienkov2020-07-271-1/+2
| | | | | | | | | | We need to exclude the '--deprecated_feature_warnings' flag for the IAR SH compiler, because this flag is not supported. Also we need to set the architecture-specific linker options. Change-Id: I038fe6972aeed9deb8cc3e76308cb1e393a15b8b Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* baremetal: Pass all current tests for IAR R32CDenis Shienkov2020-07-261-1/+1
| | | | | | | | We need to exclude the '--deprecated_feature_warnings' flag for the IAR R32C compiler, because this flag is not supported. Change-Id: I96ba6e177c0ba38c6fda99a89fde5d7664011315 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* baremetal: Pass all current tests for IAR AVR32Denis Shienkov2020-07-261-4/+6
| | | | | | | | We need to exclude the '--deprecated_feature_warnings' flag for the IAR AVR32 compiler, because this flag is not supported. Change-Id: Ia8a39b4049a673409ff20850d0c64b6ff6822a4b Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* baremetal: Don't pass cpp.driverFlags to IAR assemblerDenis Shienkov2020-07-161-2/+1
| | | | | | | | | ... because the cpp.driverFlags intended only for the compiler and the linker; the assembler required the cpp.assemblerFlags instead. Change-Id: I0758937d40f02cbc6ff76b36b7c11fe5f4ddcf08 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* baremetal: Implement cpp.prefixHeaders for IAR and KEIL toolchainsDenis Shienkov2020-06-291-0/+4
| | | | | | | | | | | Right now it is possible to use the cpp.prefixHeaders property for the KEIL ARM MDK and the IAR EW toolchains. Take into account that the IAR EW toolchain support only one preinclude file. Change-Id: I9e367825575409fa446f3b012a0e1e8d156643ef Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* baremetal: Fix architecture code detection for ARM using IAR toolchainDenis Shienkov2020-06-281-1/+5
| | | | | | | | We need to use architecture.startsWith("arm") for the ARM architecture, because now the ARM architecture has detailed name (like 'armv7 and etc). Change-Id: Ia9bed35af66de954ec47d8b4a0622a6ad78bf074 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* baremetal: Fix linker name detection for ARM using IAR toolchainDenis Shienkov2020-06-221-1/+1
| | | | | | | | | | | | | | | | | | | This commit ab0abfc introduced a regression in the detection of a linker name for the ARM architecture. A problem is that now the ARM architecture has a detailed name, e.g. "armv7", "armv6", against the previous "arm" name. In this case the following code: "ilink" + architecture returns a wrong linker name, e.g. "ilinkarmv7" instead of "ilinkarm". So, we need to check on ARM architecture and then return a valid linker name directly. Change-Id: I4f44cdc9875f00676bc36cfa4fc36b36b92a8190 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* baremetal: Fix generation of static libraries using IAR toolchainDenis Shienkov2020-06-161-13/+22
| | | | | | | | | | | | | | A problem was in that we use wrong 'xlib' utility to create the static libraries; we need to use the 'xar' utility instead. This utility delivered only for the following architectures: mcs51, avr, avr32, msp430, v850, 78k, m68k, m32c, r32c, m16c, cr16 in other cases we need to use the 'iarchive' utility. Change-Id: I69660d22842e2011aa02187021f491f270491144 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* baremetal: Fix handling include paths for all IAR toolchainsDenis Shienkov2020-06-131-6/+6
| | | | | | | | | | | This commit fixes handling for include paths properties which are passed to the compiler or assembler arguments: * We don't need to handle the cpp.compilerIncludePaths property. * We need to handle the missing cpp.distributionLibraryPaths property. Change-Id: I8ec7f02d019431c98d1659e2f2a6da4fa2506c7c Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* baremetal: Add IAR National Semiconductor CR16 toolchain supportDenis Shienkov2020-05-251-5/+17
| | | | | | | | | | | This commit adds a basic support of the IAR Embedded Workbench toolchain for the National Semiconductor CR16 processors family: * https://en.wikipedia.org/wiki/CompactRISC Change-Id: Idb241341a450ea5669e43c0ae7c0338be43ec16a Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* baremetal: Add IAR Renesas M16C/R8C toolchain supportDenis Shienkov2020-05-251-4/+14
| | | | | | | | | | | This commit adds a basic support of the IAR Embedded Workbench toolchain for the Renesas M16C/R8C processors family: * https://www.renesas.com/us/en/products/microcontrollers-microprocessors/m16c.html Change-Id: I1985d16bd74434d78b2f571a209d314f5c147361 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* baremetal: Add IAR Renesas R32C toolchain supportDenis Shienkov2020-05-251-5/+18
| | | | | | | | | | | This commit adds a basic support of the IAR Embedded Workbench toolchain for the Renesas R32C processors family: * https://www.renesas.com/us/en/products/microcontrollers-microprocessors/m16c.html Change-Id: I8f6cd1025df63f7521e3e7ac7e6d21570f320085 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* baremetal: Add IAR Renesas M32C toolchain supportDenis Shienkov2020-05-191-4/+13
| | | | | | | | | | | This commit adds a basic support of the IAR Embedded Workbench toolchain for the Renesas M32C processors family: * https://www.renesas.com/us/en/products/microcontrollers-microprocessors/m16c.html Change-Id: I87026acbf83a204ceb9821271038582f8f6e7ae5 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* baremetal: Add IAR ColdFire (aka M68K) toolchain supportDenis Shienkov2020-05-181-5/+18
| | | | | | | | | | | | | This commit adds a basic support of the IAR Embedded Workbench toolchain for the NXP ColdFire processors family: * https://www.nxp.com/products/processors-and-microcontrollers/legacy-mcu-mpus/32-bit-coldfire-mcus-mpus:PC68KCF This ColdFire architecture is an enhancement to the previous M68K architecture. Change-Id: Idb4c0cee5ca5a09fe8a070ee32212de68e0e7e78 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* baremetal: Add IAR RISC-V toolchain supportDenis Shienkov2020-05-141-6/+14
| | | | | | | | | | | This commit adds a basic support of the IAR Embedded Workbench toolchain for the RISC-V processors family: * https://riscv.org/ Change-Id: Ida1b66b84744b4c1101582da93dfdfdee1d2344c Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* baremetal: Add IAR Renesas SH toolchain supportDenis Shienkov2020-05-141-6/+15
| | | | | | | | | | | This commit adds a basic support of the IAR Embedded Workbench toolchain for the Renesas SH processors family: * https://www.renesas.com/cn/en/products/microcontrollers-microprocessors/superh.html Change-Id: I04a0b1d73f27898ad18cc3eb9949caaf2a0d0647 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* baremetal: Fix typo at linker type detection in IAR 'cpp' moduleDenis Shienkov2020-05-141-2/+2
| | | | | | | | This regression was introduced in commit 6221562. Change-Id: Idbbe712827069677e9b8f4a8a524e4d3be09c19c Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* baremetal: Simplify output artifact extensions handling for IAR toolchainDenis Shienkov2020-05-111-65/+40
| | | | | | | | | | | | | | | | Some architectures in IAR have 'magic' code names, e.g. "avr" equals with '90', "avr32" equals with '82' and so forth. Besides, an output artifacts for executable/object/library objects contains that 'magic' codes in own file extensions. So, it is makes sense to create the separate function which return that 'magic' codes and to use this function inside of executable/object/library extensions generation to simplify a code and to minimize the copy/paste operations. Change-Id: Id2223bc577847c616f58bc4eb736d3192a3285a7 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* baremetal: Fix handling cpp.libraryPaths for IAR toolchainDenis Shienkov2020-05-061-21/+19
| | | | | | | | | | | | | | | | An IAR toolchain contains two different linkers (xlinker and ilinker), which are depend on a target architecture. These linkers have different command line options, one of which is a libraries search paths: * '-L' for xlinker * '-I' for ilinker But we always used '-L' flag, that was wrong, because we need to separate it only for xlinker. Change-Id: Ib2b482d4e9ac4aaefdf47c81f16c6c389243f56d Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* baremetal: Add IAR AVR32 toolchain supportDenis Shienkov2020-05-061-7/+23
| | | | | | | | | | | This commit adds a basic support of the IAR Embedded Workbench toolchain for the AVR32 processors family: * https://www.iar.com/iar-embedded-workbench/#!?architecture=AVR32 Change-Id: I9e93055301f6cb0689246a4f97350b622324b04f Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* baremetal: Fetch ARM architecture details from IAR toolchainDenis Shienkov2020-04-061-164/+147
| | | | | | | | | | | | | | | | | | Previously, we did not take into account the specific architecture of the target processor and always returned the abstract "arm" name. Right now we handle the '__CORE__' pre-defined macros to extend the ARM architecture name, see "IAR C/C++ Development Guide for Advanced RISC Machines Ltd’s ARM Cores" document: * http://supp.iar.com/filespublic/updinfo/004916/arm/doc/EWARM_DevelopmentGuide.ENU.pdf Besides, we improved code a bit and changed all switch/case to the if/else conditions due to new features. Change-Id: I5d62823557bdf849ad22f2df41c3f6b42f91b608 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* baremetal: Add IAR Renesas 78K toolchain supportDenis Shienkov2020-03-161-7/+28
| | | | | | | | | | | This commit adds a basic support of the IAR Embedded Workbench toolchain for the Renesas 78K processors family: * https://www.renesas.com/cn/en/products/microcontrollers-microprocessors/78k.html Change-Id: Ie1c9cbaaf7d1c883115129ebb54c1efb74e6c5ee Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* baremetal: Add IAR Renesas V850 toolchain supportDenis Shienkov2020-03-161-0/+19
| | | | | | | | | | | This commit adds a basic support of the IAR Embedded Workbench toolchain for the Renesas V850 processors family: * https://www.renesas.com/cn/en/products/microcontrollers-microprocessors/v850.html Change-Id: I289b2c9718ea917b04a1f14a3d2c70f4f26359d8 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>