Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: Prevent regenerating dfu multi image on every build #19636

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions cmake/dfu_multi_image.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,18 @@ function(dfu_multi_image_package TARGET_NAME)
string(REPLACE ";" "\n" SCRIPT_ARGS "${SCRIPT_ARGS}")
file(GENERATE OUTPUT ${ARG_OUTPUT}.args CONTENT ${SCRIPT_ARGS})

add_custom_target(${TARGET_NAME} ALL
add_custom_command(
COMMAND
${Python3_EXECUTABLE}
${ZEPHYR_NRF_MODULE_DIR}/scripts/bootloader/dfu_multi_image_tool.py
@${ARG_OUTPUT}.args
BYPRODUCTS
OUTPUT
${ARG_OUTPUT}
DEPENDS
${ARG_DEPENDS}
)
add_custom_target(${TARGET_NAME} ALL
DEPENDS
${ARG_OUTPUT}
)
endfunction()
2 changes: 1 addition & 1 deletion subsys/bootloader/cmake/packaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if(SB_CONFIG_DFU_MULTI_IMAGE_PACKAGE_BUILD)

list(APPEND dfu_multi_image_ids 0)
list(APPEND dfu_multi_image_paths "${${DEFAULT_IMAGE}_image_dir}/zephyr/${${DEFAULT_IMAGE}_kernel_name}.signed.bin")
list(APPEND dfu_multi_image_targets ${DEFAULT_IMAGE}_extra_byproducts)
list(APPEND dfu_multi_image_targets ${DEFAULT_IMAGE}_extra_byproducts ${dfu_multi_image_paths})
endif()

if(SB_CONFIG_DFU_MULTI_IMAGE_PACKAGE_NET)
Expand Down