cmake: Generate .hex files only where needed
This avoids generating useless intermediate .hex files during multi-language builds.
This commit is contained in:
parent
ac84dd1457
commit
ac1fca4a6a
|
|
@ -329,9 +329,6 @@ function(add_base_binary variant_name)
|
||||||
target_link_options(${variant_name} PUBLIC
|
target_link_options(${variant_name} PUBLIC
|
||||||
-Wl,--defsym=__TEXT_REGION_LENGTH__=248K)
|
-Wl,--defsym=__TEXT_REGION_LENGTH__=248K)
|
||||||
|
|
||||||
# generate firmware.bin file
|
|
||||||
objcopy(${variant_name} "ihex" ".hex")
|
|
||||||
|
|
||||||
# produce ASM listing. Note we also specify the .map as a byproduct so it gets
|
# produce ASM listing. Note we also specify the .map as a byproduct so it gets
|
||||||
# cleaned because link_options doesn't have a "generated outputs" feature.
|
# cleaned because link_options doesn't have a "generated outputs" feature.
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
|
|
@ -383,9 +380,9 @@ function(fw_add_variant variant_name)
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
TARGET ${FW_EN}
|
TARGET ${FW_EN}
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
COMMAND ${CMAKE_OBJCOPY} -O ihex ${CMAKE_CURRENT_BINARY_DIR}/${FW_EN}
|
COMMAND ${CMAKE_OBJCOPY} -O ihex ${FW_EN} ${FW_EN}.hex
|
||||||
${FW_HEX}
|
COMMAND ${CMAKE_OBJCOPY} -O ihex ${FW_EN} ${FW_HEX}
|
||||||
BYPRODUCTS ${FW_HEX}
|
BYPRODUCTS ${FW_EN}.hex ${FW_HEX}
|
||||||
COMMENT "Generating ${FW_EN}.hex")
|
COMMENT "Generating ${FW_EN}.hex")
|
||||||
add_dependencies(ALL_ENGLISH ${FW_EN})
|
add_dependencies(ALL_ENGLISH ${FW_EN})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue