mirror of https://github.com/ARMmbed/mbed-os.git
Use a cleaner CMake method to handle bin and hex file names
parent
0874f74ae9
commit
5442e2405c
|
@ -46,7 +46,10 @@ set(MBED_UPLOAD_SUPPORTS_DEBUG ${UPLOAD_SUPPORTS_DEBUG} CACHE INTERNAL "" FORCE)
|
|||
|
||||
function(mbed_generate_upload_debug_targets target)
|
||||
# add upload target
|
||||
gen_upload_target(${target} ${CMAKE_CURRENT_BINARY_DIR}/${target}.bin ${CMAKE_CURRENT_BINARY_DIR}/${target}.hex)
|
||||
gen_upload_target(${target}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/$<TARGET_FILE_BASE_NAME:${target}>.bin
|
||||
${CMAKE_CURRENT_BINARY_DIR}/$<TARGET_FILE_BASE_NAME:${target}>.hex
|
||||
)
|
||||
|
||||
# add debug target
|
||||
if(MBED_UPLOAD_SUPPORTS_DEBUG)
|
||||
|
|
|
@ -6,12 +6,8 @@
|
|||
#
|
||||
function(mbed_generate_bin_hex target)
|
||||
get_property(elf_to_bin GLOBAL PROPERTY ELF2BIN)
|
||||
get_target_property(artifact_name ${target} ARTIFACT_NAME)
|
||||
|
||||
# set to the target name if the property is unset
|
||||
if(artifact_name STREQUAL "artifact_name-NOTFOUND" OR artifact_name STREQUAL "")
|
||||
set(artifact_name ${target})
|
||||
endif()
|
||||
set(artifact_name $<TARGET_FILE_BASE_NAME:${target}>)
|
||||
|
||||
if (MBED_TOOLCHAIN STREQUAL "GCC_ARM")
|
||||
# The first condition is quoted in case MBED_OUTPUT_EXT is unset
|
||||
|
|
Loading…
Reference in New Issue