Skip to content

Commit 2331e6f

Browse files
authored
Fix dependency on files used by picotool (#2027)
Add the key files and partition table JSON to the link dependencies, to ensure the postprocessing is run when any of them are updated. Link dependencies seem to be the simplest way, as the elf file needs re-linking anyway given it has been post-processed, so this doesn't add any unecessary extra processing. Without this fix, if you modify a pt.json file or a private key, the ouptut binary will not have the correct pt/key.
1 parent 809a423 commit 2331e6f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tools/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ function(picotool_postprocess_binary TARGET)
427427
if (picotool_sign_output)
428428
list(APPEND picotool_args "--sign")
429429
get_target_property(picotool_sigfile ${TARGET} PICOTOOL_SIGFILE)
430+
pico_add_link_depend(${TARGET} ${picotool_sigfile})
430431
endif()
431432

432433
get_target_property(picotool_hash_output ${TARGET} PICOTOOL_HASH_OUTPUT)
@@ -442,10 +443,19 @@ function(picotool_postprocess_binary TARGET)
442443

443444
# Embed PT properties
444445
get_target_property(picotool_embed_pt ${TARGET} PICOTOOL_EMBED_PT)
446+
if (picotool_embed_pt)
447+
pico_add_link_depend(${TARGET} ${picotool_embed_pt})
448+
endif()
445449

446450
# Encryption properties
447451
get_target_property(picotool_aesfile ${TARGET} PICOTOOL_AESFILE)
452+
if (picotool_aesfile)
453+
pico_add_link_depend(${TARGET} ${picotool_aesfile})
454+
endif()
448455
get_target_property(picotool_enc_sigfile ${TARGET} PICOTOOL_ENC_SIGFILE)
456+
if (picotool_enc_sigfile)
457+
pico_add_link_depend(${TARGET} ${picotool_enc_sigfile})
458+
endif()
449459

450460
# Extra args
451461
get_target_property(extra_process_args ${TARGET} PICOTOOL_EXTRA_PROCESS_ARGS)

0 commit comments

Comments
 (0)