Use cmake's binutils paths for custom targets

Again, this fixes the build when multiple versions of binutils/avr
toolchains are avalable.
pull/21/head
Yuri D'Elia 2021-06-11 18:05:24 +02:00 committed by DRracer
parent f30c009304
commit 070552200a
1 changed files with 7 additions and 3 deletions

View File

@ -166,11 +166,15 @@ if(CMAKE_CROSSCOMPILING)
# produce ASM listing # produce ASM listing
add_custom_command( add_custom_command(
TARGET firmware POST_BUILD COMMAND avr-objdump ARGS -CSd firmware > firmware.asm TARGET firmware POST_BUILD
) COMMAND ${CMAKE_OBJDUMP} -CSd firmware > firmware.asm
)
# inform about the firmware's size in terminal # inform about the firmware's size in terminal
add_custom_command(TARGET firmware POST_BUILD COMMAND avr-size ARGS -C --mcu=atmega32u4 firmware) add_custom_command(
TARGET firmware POST_BUILD
COMMAND ${CMAKE_SIZE_UTIL} -C --mcu=atmega32u4 firmware
)
report_size(firmware) report_size(firmware)
# generate linker map file # generate linker map file