Fix dependency on boot_stage2 so that changes actually cause update of .S and relink of main application elf

This commit is contained in:
graham sanderson 2021-01-30 20:09:09 -06:00 committed by Luke Wren
parent da63ddd6ef
commit 4a0586225c

View File

@ -38,18 +38,16 @@ function(pico_define_boot_stage2 NAME SOURCES)
set(ORIGINAL_BIN ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.bin) set(ORIGINAL_BIN ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.bin)
set(PADDED_CHECKSUMMED_ASM ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_padded_checksummed.S) set(PADDED_CHECKSUMMED_ASM ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_padded_checksummed.S)
add_custom_target(${NAME}_bin DEPENDS ${ORIGINAL_BIN})
add_dependencies(${NAME}_bin ${NAME})
add_custom_command(OUTPUT ${ORIGINAL_BIN} COMMAND ${CMAKE_OBJCOPY} -Obinary $<TARGET_FILE:${NAME}> ${ORIGINAL_BIN})
find_package (Python3 REQUIRED COMPONENTS Interpreter) find_package (Python3 REQUIRED COMPONENTS Interpreter)
add_custom_command(OUTPUT ${PADDED_CHECKSUMMED_ASM}
add_custom_target(${NAME}_bin DEPENDS ${ORIGINAL_BIN})
add_custom_command(OUTPUT ${ORIGINAL_BIN} DEPENDS ${NAME} COMMAND ${CMAKE_OBJCOPY} -Obinary $<TARGET_FILE:${NAME}> ${ORIGINAL_BIN})
add_custom_target(${NAME}_padded_checksummed_asm DEPENDS ${PADDED_CHECKSUMMED_ASM})
add_custom_command(OUTPUT ${PADDED_CHECKSUMMED_ASM} DEPENDS ${ORIGINAL_BIN}
COMMAND ${Python3_EXECUTABLE} ${PICO_BOOT_STAGE2_DIR}/pad_checksum -s 0xffffffff ${ORIGINAL_BIN} ${PADDED_CHECKSUMMED_ASM} COMMAND ${Python3_EXECUTABLE} ${PICO_BOOT_STAGE2_DIR}/pad_checksum -s 0xffffffff ${ORIGINAL_BIN} ${PADDED_CHECKSUMMED_ASM}
) )
add_custom_target(${NAME}_padded_checksummed_asm DEPENDS ${PADDED_CHECKSUMMED_ASM})
add_dependencies(${NAME}_padded_checksummed_asm ${NAME}_bin)
add_library(${NAME}_library INTERFACE) add_library(${NAME}_library INTERFACE)
add_dependencies(${NAME}_library ${NAME}_padded_checksummed_asm) add_dependencies(${NAME}_library ${NAME}_padded_checksummed_asm)