Hi,
Dear team, please consider adopting LazyFetch [1]. Features:
* Optimizes on build speed (hence being "lazy"). If the binary is available will skip building, if the source is available will skip fetching. If you need to ensure the component is up-to-date, a clean build is needed. * It integrates well with cmake projects, but can support other build systems too. Note: if an extra step is needed between the fetch and the build phase, that is not supported yet (except for applying a patch). * It supports "initial cache files" as a convenient way to configure external cmake projects. Initial cache files avoid parameters being passed through multiple interpreting layers (cmake, shell, makefile, shell again). * It builds the external component during the config phase. This allows communication between the host project's and external component's build systems as the output of the external component build will be available during config phase of host. * It works as an extra layer on top of FetchContent.cmake.
For an example how it is used see here: qcbor [2] and it's initial cache file [3].
Moreover, we might consider creating a tf.org specific "cmake library". This would contain scripts and would help sharing cmake code between tf.org projects. All external components in TS would be a good candidate, but some scripts form the tf-a cmake repo are worth being considered too.
[1]: https://git.trustedfirmware.org/TS/trusted-services.git/tree/tools/cmake/com... [2]: https://git.trustedfirmware.org/TS/trusted-services.git/tree/external/qcbor/... [3]: https://git.trustedfirmware.org/TS/trusted-services.git/tree/external/qcbor/...
From: Bohdan.Hunko--- via TF-M tf-m@lists.trustedfirmware.org Sent: 12 April 2022 13:19 To: tf-m@lists.trustedfirmware.org Subject: [TF-M] Library fetching improvements
Hi, Recently I have been adding some new libraries to my TFM project and what I always end up doing is: go to some existing file which fetches the library, copy code from there, paste it to my file, change few links, versions and names.
It is a bit annoying to copy-paste that code each time, also it is hard to maintain (if pattern for fetching libraries changes) and also copy pasting might lead to some code not being updated.
My proposal is to have a function that can be used to fetch a library. This way it will be easier to add new libraries and this change will make code cleaner.
Please let me know your thoughts on this proposal.
Regards Bohdan Hunko
Cypress Semiconductor Ukraine Engineer CSUKR CSS ICW SW FW Mobile: +38099 50 19 714 Bohdan.Hunko@infineon.commailto:Bohdan.Hunko@infineon.com