Adds a new CMake helper function that can be used from sysbuild to
set or update sysbuild CMake cache variables.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Fixes an issue whereby the direct variable was being used instead
of the cache variable when configuring target images.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Provide a uniform way for sysbuild modules to create hooks that are
called at specific time during sysbuild CMake configure time.
A module can create functions following the scheme:
- <module-name>_pre_cmake
- <module-name>_post_cmake
- <module-name>_pre_domains
- <module-name>_post_domains
those functions, if defined, will be called by sysbuild CMake at the
location indicated by the function name.
A new global variable `SYSBUILD_CURRENT_MODULE_NAME` is created, which
a module can use to know it's own name when defining those functions
during sysbuild module CMake inclusion.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Split running CMake from ExternalZephyrProject_add().
This will allow systems to define all Zephyr projects and then at later
stages run the CMake configure stage.
This makes it both cleaner when CMake is invoked as well as prepare for
future work where images could be depending on CMake outcome from other
projects.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Fixes: #52353
If a CMake variable is available in both local scope and as CMake cache
variable, then the use of `${<var>}` fetches the local scoped variable.
If only the cache variable is set, then things works as expected.
Ensure that the cached variable is always the variable being shared to
images by using `$CACHE{<var>}` instead.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Load image kconfig setting into image target properties.
This allows sysbuild to evaluate and check image configuration as part
of CMake invocation.
sysbuild_get() is updated to support reading of CMake cache or Kconfig
settings for an image.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit introduces the possibility of a sample to locate
configuration files for extra images that are used when building with
MCUboot.
This allows use-cases where a sample, A, want to include MCUboot but has
adjustments to the default MCUboot configuration.
By adding a Kconfig fragment `<sample>/sysbuild/mcuboot.conf`, then that
fragment will be used together with the default configuration for
MCUboot.
It is also possible to completely replace the MCUboot configuration.
This is done by creating `<sample>/sysbuild/mcuboot/` folder.
This folder will then be used as the `APPLICATION_CONFIG_DIR` when
building MCUboot.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit loads the CMakeCache of Zephyr projects.
This allows sysbuild to fetch information from Zephyr projects into
sysbuild itself.
This commit is a first step in the process of sharing more knowledge
between images and sysbuild, and pave the way for closer sharing of
settings between images.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Enhance sysbuild controlled configurations.
The current scheme of passing settings using `-D` on the CMake
invocation is vulnerable to quoting and lists.
With `zephyr_get()` in place as a uniform way of handling user
controlled settings (CMake cache / environment / CMake local variable)
we have a mechanism in place for a cleaner handling of sysbuild
controlled settings.
This improves the robustness of variable passing and add the same cleans
up and simplifies the logic in sysbuild.
The Kconfig Zephyr CMake module has been updated accordingly so that
CONFIG settings are taken from the sysbuild shadow cache when sysbuild
is used as higher level build system.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This is the initial commit with system build, sysbuild.
Using CMake as infrastructure together with the Zephyr sysbuild allows
us to support a convenient way of building a sample and allow for extra
images to be built as part of a larger system.
It uses Kconfig for configuration of image builds.
This allows for future extension with additional build images.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>