cmake: create domains.yaml
Support creation of domains.yaml to support `west <build|flash|debug> --domain` when working with sysbuild multi image. Each Zephyr based image is added to list of domain that can be handled by the Zephyr west extension commands. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit is contained in:
parent
3d520dde2b
commit
598bea0899
3 changed files with 19 additions and 0 deletions
|
@ -36,9 +36,13 @@ ExternalZephyrProject_Add(
|
||||||
SOURCE_DIR ${APP_DIR}
|
SOURCE_DIR ${APP_DIR}
|
||||||
MAIN_APP
|
MAIN_APP
|
||||||
)
|
)
|
||||||
|
list(APPEND IMAGES "${app_name}")
|
||||||
|
set(DEFAULT_IMAGE "${app_name}")
|
||||||
|
|
||||||
add_subdirectory(bootloader)
|
add_subdirectory(bootloader)
|
||||||
|
|
||||||
# This allows for board and app specific images to be included.
|
# This allows for board and app specific images to be included.
|
||||||
include(${BOARD_DIR}/sysbuild.cmake OPTIONAL)
|
include(${BOARD_DIR}/sysbuild.cmake OPTIONAL)
|
||||||
include(${APP_DIR}/sysbuild.cmake OPTIONAL)
|
include(${APP_DIR}/sysbuild.cmake OPTIONAL)
|
||||||
|
|
||||||
|
include(cmake/domains.cmake)
|
||||||
|
|
|
@ -8,4 +8,7 @@ if(SB_CONFIG_BOOTLOADER_MCUBOOT)
|
||||||
APPLICATION mcuboot
|
APPLICATION mcuboot
|
||||||
SOURCE_DIR ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/
|
SOURCE_DIR ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/
|
||||||
)
|
)
|
||||||
|
# MCUBoot default configuration is to perform a full chip erase.
|
||||||
|
# Placing MCUBoot first in list to ensure it is flashed before other images.
|
||||||
|
set(IMAGES "mcuboot" ${IMAGES} PARENT_SCOPE)
|
||||||
endif()
|
endif()
|
||||||
|
|
12
share/sysbuild/cmake/domains.cmake
Normal file
12
share/sysbuild/cmake/domains.cmake
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
# Copyright (c) 2021 Nordic Semiconductor
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
set(domains_yaml "default: ${DEFAULT_IMAGE}")
|
||||||
|
set(domains_yaml "${domains_yaml}\nbuild_dir: ${CMAKE_BINARY_DIR}")
|
||||||
|
set(domains_yaml "${domains_yaml}\ndomains:")
|
||||||
|
foreach(image ${IMAGES})
|
||||||
|
set(domains_yaml "${domains_yaml}\n - name: ${image}")
|
||||||
|
set(domains_yaml "${domains_yaml}\n build_dir: $<TARGET_PROPERTY:${image},_EP_BINARY_DIR>")
|
||||||
|
endforeach()
|
||||||
|
file(GENERATE OUTPUT ${CMAKE_BINARY_DIR}/domains.yaml CONTENT "${domains_yaml}")
|
Loading…
Add table
Add a link
Reference in a new issue