2021-11-22 20:55:57 +08:00
|
|
|
# Copyright (c) 2021 Nordic Semiconductor
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2023-05-15 17:19:47 +08:00
|
|
|
sysbuild_images_order(IMAGES_FLASHING_ORDER FLASH IMAGES ${IMAGES})
|
|
|
|
|
2021-11-22 20:55:57 +08:00
|
|
|
set(domains_yaml "default: ${DEFAULT_IMAGE}")
|
|
|
|
set(domains_yaml "${domains_yaml}\nbuild_dir: ${CMAKE_BINARY_DIR}")
|
|
|
|
set(domains_yaml "${domains_yaml}\ndomains:")
|
sysbuild: Do not exclude images from domains.yaml
The recent support for BUILD_ONLY images was implemented by excluding
them from `domains.yaml`, in order to crudely prevent them from being
picked up by `west flash`. Arguably, this is incorrect or unexpected,
because the sysbuild documentation defines a "domain" as:
Every Zephyr CMake build system managed by sysbuild.
Another consequence is that, given a build-only `<image>`, this makes it
impossible to pass `--domain <image>` to `west flash`, `west debug`, and
ironically `west build`.
To fix that, `domains.yaml` should again represent all domains, and the
build-only ones should be indicated in another way. Enter `flash_order`:
a new top-level key in the domains YAML schema. It contains the default
sequence of images used by `west flash`, where the build-only images are
excluded, and the order is influenced by `sysbuild_add_dependencies()`.
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2023-09-25 18:45:10 +08:00
|
|
|
foreach(image ${IMAGES})
|
2021-11-22 20:55:57 +08:00
|
|
|
set(domains_yaml "${domains_yaml}\n - name: ${image}")
|
|
|
|
set(domains_yaml "${domains_yaml}\n build_dir: $<TARGET_PROPERTY:${image},_EP_BINARY_DIR>")
|
|
|
|
endforeach()
|
sysbuild: Do not exclude images from domains.yaml
The recent support for BUILD_ONLY images was implemented by excluding
them from `domains.yaml`, in order to crudely prevent them from being
picked up by `west flash`. Arguably, this is incorrect or unexpected,
because the sysbuild documentation defines a "domain" as:
Every Zephyr CMake build system managed by sysbuild.
Another consequence is that, given a build-only `<image>`, this makes it
impossible to pass `--domain <image>` to `west flash`, `west debug`, and
ironically `west build`.
To fix that, `domains.yaml` should again represent all domains, and the
build-only ones should be indicated in another way. Enter `flash_order`:
a new top-level key in the domains YAML schema. It contains the default
sequence of images used by `west flash`, where the build-only images are
excluded, and the order is influenced by `sysbuild_add_dependencies()`.
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2023-09-25 18:45:10 +08:00
|
|
|
set(domains_yaml "${domains_yaml}\nflash_order:")
|
|
|
|
foreach(image ${IMAGES_FLASHING_ORDER})
|
|
|
|
set(flash_cond "$<NOT:$<BOOL:$<TARGET_PROPERTY:${image},BUILD_ONLY>>>")
|
|
|
|
set(domains_yaml "${domains_yaml}$<${flash_cond}:\n - ${image}>")
|
|
|
|
endforeach()
|
2021-11-22 20:55:57 +08:00
|
|
|
file(GENERATE OUTPUT ${CMAKE_BINARY_DIR}/domains.yaml CONTENT "${domains_yaml}")
|