Skip to content

Commit

Permalink
cmake: place merged.hex CMAKE_BINARY_DIR
Browse files Browse the repository at this point in the history
partition_manager.cmake creates `merged.hex` as
`${PROJECT_BINARY_DIR}/merged.hex`.

Adjust `${PROJECT_BINARY_DIR}/merged.hex` to
`${CMAKE_BINARY_DIR}/merged.hex` so that external tools / tests / etc.
which looks for `merged.hex` at top-level build folder can still find
it.

Signed-off-by: Torsten Rasmussen <[email protected]>
  • Loading branch information
tejlmand committed Jun 14, 2024
1 parent 3fcbec1 commit c84b03a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions cmake/sysbuild/partition_manager.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ function(partition_manager)
set(${part}_PM_TARGET ${part})
else()
if(${part} IN_LIST containers)
set_ifndef(${part}_PM_HEX_FILE ${PROJECT_BINARY_DIR}/${part}.hex)
set_ifndef(${part}_PM_HEX_FILE ${CMAKE_BINARY_DIR}/${part}.hex)
set_ifndef(${part}_PM_TARGET ${part}_hex)
endif()
list(APPEND implicitly_assigned ${part})
Expand Down Expand Up @@ -275,11 +275,11 @@ function(partition_manager)
# And under which circumstances.
# Add command to merge files.
add_custom_command(
OUTPUT ${PROJECT_BINARY_DIR}/${container}.hex
OUTPUT ${CMAKE_BINARY_DIR}/${container}.hex
COMMAND
${PYTHON_EXECUTABLE}
${ZEPHYR_BASE}/scripts/build/mergehex.py
-o ${PROJECT_BINARY_DIR}/${container}.hex
-o ${CMAKE_BINARY_DIR}/${container}.hex
${${container}overlap_arg}
${${container}hex_files}
DEPENDS
Expand All @@ -291,16 +291,16 @@ function(partition_manager)
add_custom_target(
${container}_hex
ALL DEPENDS
${PROJECT_BINARY_DIR}/${container}.hex
${CMAKE_BINARY_DIR}/${container}.hex
)

if (DEFINED PM_DOMAIN)
get_property(image_name GLOBAL PROPERTY DOMAIN_APP_${PM_DOMAIN})
update_runner(IMAGE ${image_name} HEX ${PROJECT_BINARY_DIR}/${container}.hex)
update_runner(IMAGE ${image_name} HEX ${CMAKE_BINARY_DIR}/${container}.hex)
endif()

if ("${container}" STREQUAL "merged")
update_runner(IMAGE ${DEFAULT_IMAGE} HEX ${PROJECT_BINARY_DIR}/${container}.hex)
update_runner(IMAGE ${DEFAULT_IMAGE} HEX ${CMAKE_BINARY_DIR}/${container}.hex)
endif()
endforeach()

Expand Down Expand Up @@ -782,7 +782,7 @@ else()
# End - Code related to network core update. Multi image updates are part of NCSDK-17807

# Explicitly add the root image domain hex file to the list
list(APPEND domain_hex_files ${PROJECT_BINARY_DIR}/${merged}.hex)
list(APPEND domain_hex_files ${CMAKE_BINARY_DIR}/${merged}.hex)
list(APPEND global_hex_depends ${merged}_hex)

# Now all partition manager configuration from all images and domains are
Expand Down

0 comments on commit c84b03a

Please sign in to comment.