nuttx/cmake: add cmake disassembly support for GHS compiler

add cmake disassembly support for GHS compiler

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
This commit is contained in:
wangchengdong
2025-09-15 21:03:22 +08:00
committed by Xiang Xiao
parent 36168dd244
commit 3eb1c21807

View File

@@ -52,10 +52,17 @@ function(nuttx_generate_outputs target)
endif()
if(CONFIG_RAW_DISASSEMBLY)
add_custom_command(
OUTPUT ${target}.asm
COMMAND ${CMAKE_OBJDUMP} -d ${target} > ${target}.asm
DEPENDS ${target})
if(CONFIG_ARCH_TOOLCHAIN_GHS)
add_custom_command(
OUTPUT ${target}.asm
COMMAND ${CMAKE_OBJDUMP} ${target} -ytext -yl -yp > ${target}.asm
DEPENDS ${target})
else()
add_custom_command(
OUTPUT ${target}.asm
COMMAND ${CMAKE_OBJDUMP} -d ${target} > ${target}.asm
DEPENDS ${target})
endif()
add_custom_target(${target}-asm ALL DEPENDS ${target}.asm)
file(APPEND ${CMAKE_BINARY_DIR}/nuttx.manifest "${target}.asm\n")
endif()