Fixes: #43835
In zephyr_library_compile_options() the existence of the compile
options interface library is checked and function returns if it already
exists. This results in #43835 meaning two libraries cannot add the
same option.
This commit fixes this by re-using the already created unique interface
library and link this to the Zephyr library.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The STRUCT_SECTION_ITERABLE have been renamed to drop the Z_ prefix,
this drops the last reference in the cmake comments.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Don't translate from relative to absolute include paths.
It is lost to history why this was necessary and it is causing
problems with generator expressions so we remove the logic.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Create a cmake/modules folder containing all Zephyr CMake modules.
All Zephyr cmake files that are included from boilerplate are now
converted into CMake modules which can be individually loaded.
The Zephyr CMake package is updated to support loading of individual
CMake modules using the COMPONENTS argument to `find_package(Zephyr)`.
If the COMPONENTS argument is not specified, the default Zephyr build
system will load.
If COMPONENTS is specified then, only those components and the
dependencies will be loaded.
If a Zephyr CMake module depends on another CMake module which has not
been loaded, it will automatically be loaded.
This allows us to modularize and reuse individual parts of the Zephyr
CMake build system in a more flexible way in future.
Such usage could be:
- Higher livel multi image build system
- Invocation of individual components, for example dts processing by
twister without loading all build code
- Doc build
- Unittesting
With this new CMake package and CMake module scheme then direct
sourcing of boilerplate.cmake has been deprecated.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>