Skip to content

Commit 67f8cab

Browse files
committed
cmake: sysbuild: build harness apps with app list in SB_CONFIG_HARNESS_APPS
add on kconfig option, SB_CONFIG_HARNESS_APPS for sysbuild to config harness app list, iterate each harness app to build with ExternalZephyrProject_Add Signed-off-by: Jingsai Lu <[email protected]>
1 parent 56f7dc4 commit 67f8cab

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

share/sysbuild/images/CMakeLists.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,22 @@ set(SYSBUILD_CURRENT_CMAKE_DIR)
3535
# This allows for board and SoC specific images to be included.
3636
sysbuild_add_subdirectory(boards)
3737
sysbuild_add_subdirectory(soc)
38+
39+
# parse harness app list from SB_CONFIG_HARNESS_APPS and
40+
# add these app projects into sysbuild system.
41+
if(SB_CONFIG_HARNESS_APPS)
42+
string(REPLACE "," ";" items "${SB_CONFIG_HARNESS_APPS}")
43+
message("SB_CONFIG_HARNESS_APPS: ${SB_CONFIG_HARNESS_APPS}")
44+
message("items: ${items}")
45+
46+
foreach(item IN LISTS items)
47+
message("item: ${item}")
48+
string(REPLACE "/" "_" app_name ${item})
49+
message("app_name: ${app_name}")
50+
ExternalZephyrProject_Add(
51+
APPLICATION ${app_name}
52+
SOURCE_DIR ${ZEPHYR_BASE}/${item}
53+
BOARD ${BOARD}
54+
)
55+
endforeach()
56+
endif()

share/sysbuild/images/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@
33
# SPDX-License-Identifier: Apache-2.0
44

55
rsource "bootloader/Kconfig"
6+
7+
8+
config HARNESS_APPS
9+
string "List of harness apps"
10+
help
11+
List of harness apps to be built.

0 commit comments

Comments
 (0)