File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -144,3 +144,16 @@ add_custom_target(upload
144144 COMMAND docker run --rm --network=host -v ${CMAKE_BINARY_DIR} :/workdir ghcr.io/xtech/fw-xcore-boot:latest -i tap0 upload /workdir/${CMAKE_PROJECT_NAME} .bin
145145 DEPENDS ${CMAKE_PROJECT_NAME}
146146)
147+
148+ # Check if elf-size-analyze is available
149+ find_program (ELF_SIZE_ANALYZE_EXECUTABLE elf-size-analyze)
150+
151+ if (ELF_SIZE_ANALYZE_EXECUTABLE)
152+ add_custom_command (
153+ TARGET ${CMAKE_PROJECT_NAME} POST_BUILD
154+ COMMAND ${ELF_SIZE_ANALYZE_EXECUTABLE} -R -t arm-none-eabi- ${CMAKE_PROJECT_NAME} .elf
155+ COMMENT "Running elf-size-analyze on target binary..."
156+ )
157+ else ()
158+ message (WARNING "elf-size-analyze not found! Skipping size analysis." )
159+ endif ()
You can’t perform that action at this time.
0 commit comments