mirror of https://github.com/ARMmbed/mbed-os.git
CMake: fix the output bin-hex file
$<TARGET_FILE:${target}> is the output from CMake. As it can contain suffix for some toolchains, we can use ${target} instead (output from hex/bin generation).pull/13566/head
parent
7171f62489
commit
52bc5b569c
|
@ -151,18 +151,18 @@ function(mbed_generate_bin_hex target)
|
||||||
get_property(elf_to_bin GLOBAL PROPERTY ELF2BIN)
|
get_property(elf_to_bin GLOBAL PROPERTY ELF2BIN)
|
||||||
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
|
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
|
||||||
set(CMAKE_POST_BUILD_COMMAND
|
set(CMAKE_POST_BUILD_COMMAND
|
||||||
COMMAND ${elf_to_bin} -O binary $<TARGET_FILE:${target}> $<TARGET_FILE:${target}>.bin
|
COMMAND ${elf_to_bin} -O binary $<TARGET_FILE:${target}> ${CMAKE_BINARY_DIR}/${target}.bin
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "-- built: $<TARGET_FILE:${target}>.bin"
|
COMMAND ${CMAKE_COMMAND} -E echo "-- built: ${CMAKE_BINARY_DIR}/${target}.bin"
|
||||||
COMMAND ${elf_to_bin} -O ihex $<TARGET_FILE:${target}> $<TARGET_FILE:${target}>.hex
|
COMMAND ${elf_to_bin} -O ihex $<TARGET_FILE:${target}> ${CMAKE_BINARY_DIR}/${target}.hex
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "-- built: $<TARGET_FILE:${target}>.hex"
|
COMMAND ${CMAKE_COMMAND} -E echo "-- built: ${CMAKE_BINARY_DIR}/${target}.hex"
|
||||||
)
|
)
|
||||||
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
|
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
|
||||||
get_property(mbed_studio_arm_compiler GLOBAL PROPERTY MBED_STUDIO_ARM_COMPILER)
|
get_property(mbed_studio_arm_compiler GLOBAL PROPERTY MBED_STUDIO_ARM_COMPILER)
|
||||||
set(CMAKE_POST_BUILD_COMMAND
|
set(CMAKE_POST_BUILD_COMMAND
|
||||||
COMMAND ${elf_to_bin} ${mbed_studio_arm_compiler} --bin -o $<TARGET_FILE:${target}>.bin $<TARGET_FILE:${target}>
|
COMMAND ${elf_to_bin} ${mbed_studio_arm_compiler} --bin -o ${CMAKE_BINARY_DIR}/${target}.bin $<TARGET_FILE:${target}>
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "-- built: $<TARGET_FILE:${target}>.bin"
|
COMMAND ${CMAKE_COMMAND} -E echo "-- built: ${target}.bin"
|
||||||
COMMAND ${elf_to_bin} ${mbed_studio_arm_compiler} --i32combined -o $<TARGET_FILE:${target}>.hex $<TARGET_FILE:${target}>
|
COMMAND ${elf_to_bin} ${mbed_studio_arm_compiler} --i32combined -o ${CMAKE_BINARY_DIR}/${target}.hex $<TARGET_FILE:${target}>
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "-- built: $<TARGET_FILE:${target}>.hex"
|
COMMAND ${CMAKE_COMMAND} -E echo "-- built: ${CMAKE_BINARY_DIR}/${target}.hex"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
|
|
Loading…
Reference in New Issue