aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/generators
Commit message (Collapse)AuthorAgeFilesLines
* Fix some Qt 6 build errorsChristian Kandeler2020-11-251-1/+1
| | | | | Change-Id: I80dccfacb749ecfc8bfb8000bdc26c684f2afa52 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* ProductData: return members by const-referenceIvan Komissarov2020-06-021-4/+3
| | | | | Change-Id: I865d28b8fd930820c7145a3bf8aa76b2dd677550 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* generators: Make gen::VersionInfo constexprIvan Komissarov2020-01-081-5/+5
| | | | | | Change-Id: Ia19dd5f696accb9680c958b05676d79aaaefb4b8 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* generators: Inline methods in gen::VersionInfoIvan Komissarov2020-01-082-38/+15
| | | | | | | | To be able to use in constexpr context Change-Id: If17e7346828a9c9561b0c0a1240b8d5515bae16e Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* generators: Use QFlags to represent a "set" of architecturesIvan Komissarov2020-01-083-12/+14
| | | | | | | | | This allows to avoid unneseccary allocations and use architecture "set" in a constexpr context Change-Id: I2352e899572978b3d1d7924e6f807b7441603aa7 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* generators: make VersionInfo non-virtualIvan Komissarov2020-01-071-2/+1
| | | | | | | | | | | | | There is no need to check if marketing version is a "known" version since all generators are created only based on the list on known versions, i.e. there is no way how "unknown" version object can be created If this will be required in the future, it's better to use templates or overloaded functions instead of virtual functions here Change-Id: I85367c0722dc8561b2a937d4b496677af8f901f3 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix 'performance-unnecessary-value-param' warningsIvan Komissarov2020-01-072-3/+2
| | | | | | | | | | Use more pass-by-const-ref since there is no point in passing objects by value in these cases Also, treat this warning as error Change-Id: I5382dcd56639f535cf240205cc5c3ac667c4ece3 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix 'performance-move-const-arg' warningsIvan Komissarov2019-12-091-1/+1
| | | | | | | | | | | Also, treat that warning as error In some places move is redundant (e.g. when moving int or enum), in others it wasn't working as expected (i.e. not moving, but copying instead), in some, const-ref was (uselessly) moved. Fix those places Change-Id: I0b38667a71967fa35ca627990d3c12124fb62af0 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Apply 'modernize-make-unique' fix-itIvan Komissarov2019-11-282-2/+4
| | | | | Change-Id: I93783cfa3267f69237b0ad888d0747e4272cda0a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Apply 'modernize-use-equals-default' fix-itIvan Komissarov2019-11-253-4/+4
| | | | | Change-Id: Iabdc777d2e8492d9903109365b0f3b1a5441ca11 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* baremetal: Long live the IAR EW project generator for MSP430Denis Shienkov2019-08-282-0/+3
| | | | | | | | | | | | | | | | | | | | | | | Right now it is possible to generate a native projects for the IAR Embedded Workbench IDE, e.g. using the following command: qbs generate -g iarew7 -d <path/to/build/directory> -f <path/to/qbs/project> profile:<your/qbs/profile> We need in a valid IAR EW QBS profile, from which the generator take a desired target architecture and other stuff. The IAR EW generator has a semi-intelligent logic, it parses a source QBS project and converts a compiler flags and other stuff to an appropriate configurations of the native IAR EW project. Currently it is supported only one 'iarew7' generator which allow to generate a projects for the IAR EW for MSP430 for all versions of 7 series. Tested with the IAR EW for MSP430 v7.12.4, using as the QBS bare-metal examples, and as other projects. Change-Id: Ic0bbc82e6ebb3b04bced639797976e432809171f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* baremetal: Long live the KEIL UV project generator for ARMDenis Shienkov2019-08-202-0/+51
| | | | | | | | | | | | | | | | | | | | | | | Right now it is possible to generate a native projects for the KEIL UVision IDE, e.g. using the following command: qbs generate -g keiluv5 -d <path/to/build/directory> -f <path/to/qbs/project> profile:<your/qbs/profile> We need in a valid KEIL QBS profile, from which the generator take a desired target architecture and other stuff. The KEIL UV generator has a semi-intelligent logic, it parses a source QBS project and converts a compiler flags and other stuff to an appropriate configurations of the native KEIL UVsion project. Currently it is supported only one 'keiluv5' generator which allow to generate a projects for the KEIL UVision v5 for ARM architecture. Tested with the KEIL UVision v5.23 for ARM, using as the QBS bare-metal examples, and as other projects. Change-Id: I3af9d01f25a9570a99a62d4ce2c30fec3566b9a1 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Use different names for virtual functions in INodeVisitorIvan Komissarov2019-08-169-32/+32
| | | | | | | | This fixes compiler warnings about hidden virtual functions in derived classes Change-Id: I3b53d07263f66133a41353eb6cfe05e1f3b20cc3 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Merge 1.14 into masterChristian Kandeler2019-08-021-16/+4
|\ | | | | | | Change-Id: Ib40a6fb77dfb1653910e802276571fc5dcea4d64
| * Avoid uses of Java-style iteratorshjk2019-07-301-16/+4
| | | | | | | | | | Change-Id: I90cece156033b5d223a86016401a2199f5b6c11e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | baremetal: Long live the IAR EW project generator for STM8Denis Shienkov2019-08-012-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Right now it is possible to generate a native projects for the IAR Embedded Workbench IDE, e.g. using the following command: qbs generate -g iarew3 -d <path/to/build/directory> -f <path/to/qbs/project> profile:<your/qbs/profile> We need in a valid IAR EW QBS profile, from which the generator take a desired target architecture and other stuff. The IAR EW generator has a semi-intelligent logic, it parses a source QBS project and converts a compiler flags and other stuff to an appropriate configurations of the native IAR EW project. Currently it is supported only one 'iarew3' generator which allow to generate a projects for the IAR EW for STM8 for all versions of 3 series. Tested with the IAR EW for STM8 v3.11.1, using as the QBS bare-metal examples, and as other projects. Change-Id: I47880d62cd1e81ed7bbfba840a5af0c558065013 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | baremetal: Share common generators codeDenis Shienkov2019-07-3118-2/+1403
|/ | | | | | | | | | | Common code which are used for the 'iarew' and 'keiluv' generators was moved to the corelib/generators library. Besides, this code also can be used in future for the XML-based generators. Change-Id: I79a21e3e078d563600d7f365785731fe9e847045 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Apply fix-its for the missing override keywordIvan Komissarov2019-05-031-1/+1
| | | | | | | | Missing override is a warning in clang Change-Id: I90b899df37e690aebb942bffc65db54d9aa4050f Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Use pass-by-value and moveIvan Komissarov2019-03-072-3/+3
| | | | | | | This fixes -Wmodernize-pass-by-value Change-Id: I85a732867866e43c39c1d77937fbc645433c96bd Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix calls to non-const begin()/end() in range-for loopsIvan Komissarov2019-03-061-1/+1
| | | | | | | | This fixes -Wclazy-range-loop Change-Id: I08a435b700017cdbe27fbfdbda6e26840d9a3568 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Return initializer list where it is possibleDenis Shienkov2019-02-261-2/+2
| | | | | | | | | This fixes this clang-tidy warning: warning: avoid repeating the return type from the declaration; use a braced initializer list instead [modernize-return-braced-init-list] Change-Id: I421e1e47462fe0e97788672684d47943af7df850 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Use QStringLiteral more where it is possibleDenis Shienkov2019-02-251-7/+7
| | | | | | Change-Id: I7419cc3fbc1e8776de3943852dcedab4c95d1c32 Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Replace 'typedef' with 'using' where it is possibleDenis Shienkov2019-02-231-1/+1
| | | | | | | | One exception is that the 'typedef' for function pointers were skipped due to an additional work is required. Change-Id: I2112fded3abeaee1d1f49f56adfd2914d5db0324 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* corelib: Apply modernize-use-overrideAlessandro Portale2018-08-201-1/+1
| | | | | | | Add overrides to function, except for destructors. Change-Id: I1a1337b01dfef81b74ba56c5f00bf4d4cfc10935 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectGenerator: Return an error statusChristian Kandeler2018-04-232-7/+12
| | | | | | | As per our policy not to let exceptions cross the API boundary. Change-Id: I52e1fb9448466181b73fcd0e4c74ef33f71de98e Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Merge 1.11 into masterChristian Kandeler2018-04-201-1/+1
|\ | | | | | | Change-Id: Iebe7584bd2978a8f8be093c6b366033076f83e74
| * Fix QbsGenerateCommandLine in VS project generatorJoerg Bornemann2018-04-191-1/+1
| | | | | | | | | | | | | | | | | | Configuration names must be prefixed by "config:". This amends commit caa7d868. Task-number: QBS-1303 Change-Id: Iac72218990f94a27f74bb7f9dd5ea57b92fbb0aa Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Clean up the ProjectGenerator interfaceChristian Kandeler2018-04-201-9/+7
| | | | | | | | | | | | | | | | | | Make the virtual generate() function private; it is only supposed to be called from within this class. Merge the two "private:" sections while we're at it. Change-Id: I43dbd5d45e8c5d803f1bfbf088dbe1944a59c05b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Generators API: add missing constJake Petroules2018-02-191-2/+2
|/ | | | | Change-Id: Idb590beabb1b31f88ebb47705947a31dd3da545a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Install missing header filesChristian Kandeler2018-01-111-0/+10
| | | | | Change-Id: I2fb8540ceba602f88d7bae16b09b1d95e5047abf Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Merge 1.10 into masterChristian Kandeler2018-01-051-0/+2
|\ | | | | | | Change-Id: I29a74f96381a1b77c6cb1959547314786690baa4
| * Don't crash when calling methods on empty IMultiplexableContainersJake Petroules2018-01-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | Default-constructed GeneratableProjectData objects may be passed to generator methods as placeholders (in the case of the Visual Studio generator) and calling methods on such objects must not dereference invalid iterators. Task-number: QBS-1257 Change-Id: I1c2bfff015efc98cbfb66d02b497320429b6c6da Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Do not use the set class outside corelibChristian Kandeler2017-12-071-1/+0
| | | | | | | | | | | | | | It was and is meant for internal use only. Change-Id: Ibe15f5838f9b728ec397a668a94128abe4ef5efa Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | corelib: Gather string constants in central placeChristian Kandeler2017-11-291-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The same string literals appeared over and over again in the code base, causing redundancy in the sources as well as at run-time. We now give them a name and make sure they get instantiated at most once. String literals that occur only once are converted from QLatin1String to QStringLiteral unless they appear only in contexts that make use of QLatin1String overloads or they are clearly outside of any hot code paths. This seems to result in small, but measurable performance improvements, even if we assume the 1% changes to be noise: ========== Performance data for Resolving ========== Old instruction count: 3266514138 New instruction count: 3209355927 Relative change: -2 % Old peak memory usage: 29649896 Bytes New peak memory usage: 29436264 Bytes Relative change: -1 % ========== Performance data for Rule Execution ========== Old instruction count: 3367804753 New instruction count: 3319029596 Relative change: -2 % Old peak memory usage: 19577760 Bytes New peak memory usage: 19091328 Bytes Relative change: -3 % ========== Performance data for Null Build ========== Old instruction count: 608946535 New instruction count: 604566001 Relative change: -1 % Old peak memory usage: 14606384 Bytes New peak memory usage: 14579936 Bytes Relative change: -1 % Change-Id: Ia055a52e0a4b6fe6fd0f1e7ba4bfa583cba1b0ef Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | STL compatibility: use push_back() instead of append()Jake Petroules2017-11-221-2/+2
| | | | | | | | | | | | | | | | | | | | ...or operator<< if the argument was itself a list, or brace init where appropriate. This is a simple find and replace with manual sanity check. Change-Id: I94b79cbf3752192dd258001bf1dfcd46f58ca352 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | STL compatibility: use empty() instead of isEmpty()Jake Petroules2017-11-161-2/+2
|/ | | | | | | This is a simple find and replace with manual sanity check. Change-Id: Iab6d46dcc3be246d1650aae2b1730f933b717be8 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Generator data: add some utility methods for iterating configurationsJake Petroules2017-09-011-0/+80
| | | | | | | These will be used in a subsequent commit. Change-Id: I004da66d0cb334d6de3083d63c85d153403fd56b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Generator data: add type and build directory methodsJake Petroules2017-09-012-1/+17
| | | | | | | These will be used in a subsequent commit. Change-Id: I768a3b4fa01329b43e4c993b9b4bee7d3dfb3a34 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Generator data: use a template method to reduce pattern duplicationJake Petroules2017-09-012-53/+36
| | | | | Change-Id: I7613d221fba6d343726418837ce5f3013b9a8d96 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Provide a logger instance to the generatorsJake Petroules2017-06-222-2/+14
| | | | | | | Replace a qDebug usage with it. Change-Id: I4fa34c2e48100a6ec7c10bae8d2ca186dbab9d29 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Transform the scanner plugin manager into a true generic plugin managerJake Petroules2017-06-1379-6206/+4
| | | | | | | | | | | | ...and fit the generator plugins into this new plugin structure. Plugins are now handled entirely by the build system in a generic manner and no part of qbscore (code or build files) has a direct reference to any plugin regardless of whether qbs is being built as shared or static libraries. Change-Id: I4a20546ce275df71083ee22c2cb67f781c4de764 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Merge 1.8 into masterChristian Kandeler2017-06-095-5/+78
|\ | | | | | | Change-Id: I2fcb2113a24c8807467aa03aa3e7590d53761706
| * Fix mismatched class/struct warningJake Petroules2017-06-081-1/+1
| | | | | | | | | | | | | | This fixes a regression introduced in e68a7a5. Change-Id: Ic1df82c636b8505e83fdca58c28062bd54bbea17 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
| * Add an entry for the qbs file itself in the generated vcxprojJake Petroules2017-06-064-0/+36
| | | | | | | | | | | | | | Task-number: QBS-1128 Change-Id: I632096fd350472c7274a6cb38b4ddbdf8ec04515 Reviewed-by: Thomas Epting <thomas.epting@stryker.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
| * Fix handling of same subproject names in generated VS solutionsJake Petroules2017-06-063-5/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While Qbs product names must be unambiguous, using the same project name several times is perfectly valid, as long as all projects with the same name belong to a different root project. Utilize the project's source file location to distinguish projects that have the same name. Use this in conjunction with the name to create an ID that is used as the key for the solutionFolders map. Change-Id: I47079cd4207d505892e79755a3986614025d2749 Task-number: QBS-1082 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Thomas Epting <thomas.epting@stryker.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Replace QSharedPointer/QWeakPointer with std::shared_ptr/std::weak_ptrJake Petroules2017-05-232-27/+27
|/ | | | | Change-Id: I2915c578968bed425a8d8b617b56df88ed3f2882 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Replace all uses of QVector with std::vectorJake Petroules2017-03-296-26/+20
| | | | | Change-Id: Idd41fc4d9819649a85739f984862bed6480fddd5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Replace all uses of QSet with Internal::SetJake Petroules2017-03-223-16/+14
| | | | | Change-Id: I0ba0a39b4f7d8c7c76b869584317b53b85cffc81 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Replace all uses of QPair/qMakePair with std::pair/std::make_pairJake Petroules2017-03-223-5/+6
| | | | | Change-Id: I1cde37fcf30b066130b9f5ff13743af009a6cb4f Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Merge 1.7 into masterChristian Kandeler2017-02-109-21/+110
|\ | | | | | | Change-Id: I4ca26628cb30ca75ceab0ca38d8bb253193b6166