Build epoch in info, flash-status command, cmake version embedding

This commit is contained in:
Ian Gulliver
2026-04-12 09:02:31 +09:00
parent 21c7900444
commit a41ee70a3c
9 changed files with 85 additions and 5 deletions

View File

@@ -30,6 +30,11 @@ pico_generate_pio_header(picomap ${CMAKE_CURRENT_LIST_DIR}/w6300/qspi.pio)
pico_enable_stdio_usb(picomap 0)
pico_enable_stdio_uart(picomap 0)
pico_set_binary_type(picomap copy_to_ram)
string(TIMESTAMP BUILD_EPOCH "%s" UTC)
math(EXPR VERSION_MAJOR "${BUILD_EPOCH} >> 16")
math(EXPR VERSION_MINOR "${BUILD_EPOCH} & 65535")
pico_set_binary_version(picomap MAJOR ${VERSION_MAJOR} MINOR ${VERSION_MINOR})
target_compile_definitions(picomap PRIVATE BUILD_EPOCH=${BUILD_EPOCH})
pico_add_extra_outputs(picomap)
target_link_libraries(picomap ${LIB_DEPS})
@@ -40,5 +45,7 @@ pico_generate_pio_header(picomap_test ${CMAKE_CURRENT_LIST_DIR}/w6300/qspi.pio)
pico_enable_stdio_usb(picomap_test 0)
pico_enable_stdio_uart(picomap_test 0)
pico_set_binary_type(picomap_test copy_to_ram)
pico_set_binary_version(picomap_test MAJOR ${VERSION_MAJOR} MINOR ${VERSION_MINOR})
target_compile_definitions(picomap_test PRIVATE BUILD_EPOCH=${BUILD_EPOCH})
pico_add_extra_outputs(picomap_test)
target_link_libraries(picomap_test ${LIB_DEPS})