Fix build issues with spaces and parentheses (#1136)

Add VERBATIM to add_custom_command

Fixes #1043
This commit is contained in:
Peter Harper 2022-12-06 23:45:57 +00:00 committed by GitHub
parent 56594e75af
commit 0b52603667
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 10 deletions

View File

@ -3,18 +3,20 @@
enable_language(ASM) enable_language(ASM)
function(pico_add_hex_output TARGET) function(pico_add_hex_output TARGET)
add_custom_command(TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_OBJCOPY} -Oihex $<TARGET_FILE:${TARGET}> $<IF:$<BOOL:$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>>,$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>,$<TARGET_PROPERTY:${TARGET},NAME>>.hex) add_custom_command(TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_OBJCOPY} -Oihex $<TARGET_FILE:${TARGET}> $<IF:$<BOOL:$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>>,$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>,$<TARGET_PROPERTY:${TARGET},NAME>>.hex
VERBATIM)
endfunction() endfunction()
function(pico_add_bin_output TARGET) function(pico_add_bin_output TARGET)
add_custom_command(TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_OBJCOPY} -Obinary $<TARGET_FILE:${TARGET}> $<IF:$<BOOL:$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>>,$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>,$<TARGET_PROPERTY:${TARGET},NAME>>.bin) add_custom_command(TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_OBJCOPY} -Obinary $<TARGET_FILE:${TARGET}> $<IF:$<BOOL:$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>>,$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>,$<TARGET_PROPERTY:${TARGET},NAME>>.bin
VERBATIM)
endfunction() endfunction()
function(pico_add_dis_output TARGET) function(pico_add_dis_output TARGET)
add_custom_command(TARGET ${TARGET} POST_BUILD add_custom_command(TARGET ${TARGET} POST_BUILD
COMMAND ${CMAKE_OBJDUMP} -h $<TARGET_FILE:${TARGET}> > $<IF:$<BOOL:$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>>,$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>,$<TARGET_PROPERTY:${TARGET},NAME>>.dis COMMAND ${CMAKE_OBJDUMP} -h $<TARGET_FILE:${TARGET}> > $<IF:$<BOOL:$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>>,$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>,$<TARGET_PROPERTY:${TARGET},NAME>>.dis
COMMAND ${CMAKE_OBJDUMP} -d $<TARGET_FILE:${TARGET}> >> $<IF:$<BOOL:$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>>,$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>,$<TARGET_PROPERTY:${TARGET},NAME>>.dis COMMAND ${CMAKE_OBJDUMP} -d $<TARGET_FILE:${TARGET}> >> $<IF:$<BOOL:$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>>,$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>,$<TARGET_PROPERTY:${TARGET},NAME>>.dis
) VERBATIM)
endfunction() endfunction()
function(pico_add_extra_outputs TARGET) function(pico_add_extra_outputs TARGET)

View File

@ -63,12 +63,13 @@ function(pico_define_boot_stage2 NAME SOURCES)
find_package (Python3 REQUIRED COMPONENTS Interpreter) find_package (Python3 REQUIRED COMPONENTS Interpreter)
add_custom_target(${NAME}_bin DEPENDS ${ORIGINAL_BIN}) 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_command(OUTPUT ${ORIGINAL_BIN} DEPENDS ${NAME} COMMAND ${CMAKE_OBJCOPY} -Obinary $<TARGET_FILE:${NAME}> ${ORIGINAL_BIN}
VERBATIM)
add_custom_target(${NAME}_padded_checksummed_asm DEPENDS ${PADDED_CHECKSUMMED_ASM}) add_custom_target(${NAME}_padded_checksummed_asm DEPENDS ${PADDED_CHECKSUMMED_ASM})
add_custom_command(OUTPUT ${PADDED_CHECKSUMMED_ASM} DEPENDS ${ORIGINAL_BIN} 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}
) VERBATIM)
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)

View File

@ -58,7 +58,7 @@ if (EXISTS ${PICO_CYW43_DRIVER_PATH}/${CYW43_DRIVER_TEST_FILE})
--redefine-sym _binary_${CYW43_FIRMWARE_BIN_}_end=${CYW43_FIRMWARE_PRETTY}_end --redefine-sym _binary_${CYW43_FIRMWARE_BIN_}_end=${CYW43_FIRMWARE_PRETTY}_end
--redefine-sym _binary_${CYW43_FIRMWARE_BIN_}_size=${CYW43_FIRMWARE_PRETTY}_size --redefine-sym _binary_${CYW43_FIRMWARE_BIN_}_size=${CYW43_FIRMWARE_PRETTY}_size
${CYW43_FIRMWARE_BIN} ${CYW43_FIRMWARE_OBJ} ${CYW43_FIRMWARE_BIN} ${CYW43_FIRMWARE_OBJ}
) VERBATIM)
add_library(cyw43_driver_picow INTERFACE) add_library(cyw43_driver_picow INTERFACE)
target_sources(cyw43_driver_picow INTERFACE target_sources(cyw43_driver_picow INTERFACE

View File

@ -33,7 +33,7 @@ function(pico_generate_pio_header TARGET PIO)
add_custom_command(OUTPUT ${HEADER} add_custom_command(OUTPUT ${HEADER}
DEPENDS ${PIO} DEPENDS ${PIO}
COMMAND Pioasm -o ${OUTPUT_FORMAT} ${PIO} ${HEADER} COMMAND Pioasm -o ${OUTPUT_FORMAT} ${PIO} ${HEADER}
) VERBATIM)
add_dependencies(${TARGET} ${HEADER_GEN_TARGET}) add_dependencies(${TARGET} ${HEADER_GEN_TARGET})
get_target_property(target_type ${TARGET} TYPE) get_target_property(target_type ${TARGET} TYPE)
if ("INTERFACE_LIBRARY" STREQUAL "${target_type}") if ("INTERFACE_LIBRARY" STREQUAL "${target_type}")
@ -59,6 +59,7 @@ function(pico_add_uf2_output TARGET)
endif() endif()
if (ELF2UF2_FOUND) if (ELF2UF2_FOUND)
add_custom_command(TARGET ${TARGET} POST_BUILD add_custom_command(TARGET ${TARGET} POST_BUILD
COMMAND ELF2UF2 $<TARGET_FILE:${TARGET}> ${output_path}$<IF:$<BOOL:$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>>,$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>,$<TARGET_PROPERTY:${TARGET},NAME>>.uf2) COMMAND ELF2UF2 $<TARGET_FILE:${TARGET}> ${output_path}$<IF:$<BOOL:$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>>,$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>,$<TARGET_PROPERTY:${TARGET},NAME>>.uf2
VERBATIM)
endif() endif()
endfunction() endfunction()