From 070552200a61c5c16bdfbe05811acf499920cebd Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Fri, 11 Jun 2021 18:05:24 +0200 Subject: [PATCH] Use cmake's binutils paths for custom targets Again, this fixes the build when multiple versions of binutils/avr toolchains are avalable. --- CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f56ff2..48158df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -166,11 +166,15 @@ if(CMAKE_CROSSCOMPILING) # produce ASM listing 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 - 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) # generate linker map file