This commit is contained in:
parent
792813926d
commit
43a5593e8f
@ -4,9 +4,18 @@ function(_pico_init_pioasm)
|
|||||||
find_package(Pioasm REQUIRED)
|
find_package(Pioasm REQUIRED)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
# PICO_DEFAULT_PIOASM_OUTPUT_FORMAT, default output format used by pioasm when using pico_generate_pio_header, default=c-sdk, group=build
|
||||||
function(pico_generate_pio_header TARGET PIO)
|
function(pico_generate_pio_header TARGET PIO)
|
||||||
_pico_init_pioasm()
|
_pico_init_pioasm()
|
||||||
cmake_parse_arguments(pico_generate_pio_header "" "OUTPUT_DIR" "" ${ARGN} )
|
cmake_parse_arguments(pico_generate_pio_header "" "OUTPUT_FORMAT;OUTPUT_DIR" "" ${ARGN} )
|
||||||
|
|
||||||
|
if (pico_generate_pio_header_OUTPUT_FORMAT)
|
||||||
|
set(OUTPUT_FORMAT "${pico_generate_pio_header_OUTPUT_FORMAT}")
|
||||||
|
elseif(DEFINED PICO_DEFAULT_PIOASM_OUTPUT_FORMAT)
|
||||||
|
set(OUTPUT_FORMAT "${PICO_DEFAULT_PIOASM_OUTPUT_FORMAT}")
|
||||||
|
else()
|
||||||
|
set(OUTPUT_FORMAT "c-sdk")
|
||||||
|
endif()
|
||||||
|
|
||||||
if (pico_generate_pio_header_OUTPUT_DIR)
|
if (pico_generate_pio_header_OUTPUT_DIR)
|
||||||
get_filename_component(HEADER_DIR ${pico_generate_pio_header_OUTPUT_DIR} ABSOLUTE)
|
get_filename_component(HEADER_DIR ${pico_generate_pio_header_OUTPUT_DIR} ABSOLUTE)
|
||||||
@ -23,7 +32,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 c-sdk ${PIO} ${HEADER}
|
COMMAND Pioasm -o ${OUTPUT_FORMAT} ${PIO} ${HEADER}
|
||||||
)
|
)
|
||||||
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)
|
||||||
|
@ -29,6 +29,7 @@ if (NOT Pioasm_FOUND)
|
|||||||
BINARY_DIR ${PIOASM_BINARY_DIR}
|
BINARY_DIR ${PIOASM_BINARY_DIR}
|
||||||
BUILD_ALWAYS 1 # force dependency checking
|
BUILD_ALWAYS 1 # force dependency checking
|
||||||
INSTALL_COMMAND ""
|
INSTALL_COMMAND ""
|
||||||
|
CMAKE_CACHE_ARGS "-DPIOASM_EXTRA_SOURCE_FILES:STRING=${PIOASM_EXTRA_SOURCE_FILES}"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user