Skip to content

Commit 6631ff1

Browse files
tejlmandcarlescufi
authored andcommitted
sysbuild: cmake: partition manager integration
This commit ports and updates cmake/partition_manager.cmake to a sysbuild specific version in cmake/sysbuild/partition_manager.cmake. The main reason for a new CMake file is the need to run partition manager outside of an application image build. The parent-child image scheme runs partition manager in the parent image build of each core. Sysbuild builds each image individually and the concept of a parent image of a core does not exist. The sysbuild partition manager has been updated to provide functions which allows partition manager to be invoked multiple times in same scope, once per domain (core). Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
1 parent 98951ba commit 6631ff1

File tree

5 files changed

+857
-7
lines changed

5 files changed

+857
-7
lines changed

cmake/extensions.cmake

+13
Original file line numberDiff line numberDiff line change
@@ -297,11 +297,24 @@ function(set_shared)
297297
set(multi_args "PROPERTY")
298298
cmake_parse_arguments(SHARE "${flags}" "${single_args}" "${multi_args}" ${ARGN})
299299

300+
if(SYSBUILD)
301+
# Sysbuild can read the cache directly, no reason for an extra share file.
302+
list(POP_FRONT SHARE_PROPERTY listname)
303+
if(SHARE_APPEND)
304+
list(APPEND ${listname} ${SHARE_PROPERTY})
305+
list(REMOVE_DUPLICATES ${listname})
306+
set(SHARE_PROPERTY ${${listname}})
307+
endif()
308+
set(${listname} "${SHARE_PROPERTY}" CACHE INTERNAL "shared var")
309+
return()
310+
endif()
311+
300312
check_arguments_required("set_shared" SHARE IMAGE FILE)
301313

302314
check_arguments_exclusive("set_shared" SHARE FILE IMAGE PROPERTY APPEND)
303315
check_arguments_exclusive("set_shared" SHARE IMAGE FILE)
304316

317+
305318
set(prop_target ${IMAGE_NAME}_shared_property_target)
306319
if(NOT TARGET ${prop_target})
307320
add_custom_target(${prop_target})

cmake/partition_manager.cmake

+4-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ elseif (EXISTS ${board_dir_pm_static_common})
5757
set(static_configuration_file ${board_dir_pm_static_common})
5858
endif()
5959

60-
if (EXISTS ${static_configuration_file})
60+
if (EXISTS "${static_configuration_file}" AND NOT SYSBUILD)
6161
message(STATUS "Found partition manager static configuration: "
6262
"${static_configuration_file}"
6363
)
@@ -107,7 +107,9 @@ if (NOT (
107107
(NOT IMAGE_NAME AND PM_IMAGES) OR
108108
(NOT IMAGE_NAME AND PM_DOMAINS) OR
109109
(PM_SUBSYS_PREPROCESSED AND CONFIG_PM_SINGLE_IMAGE)
110-
))
110+
)
111+
OR SYSBUILD
112+
)
111113
return()
112114
endif()
113115

0 commit comments

Comments
 (0)