cmake(bugfix):elf link should depends on starupobjs crt0.o

fix the correct dependency sequence to prevent
startupobjs from not being generated before ELF linking.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
This commit is contained in:
xuxin19 2025-11-19 21:07:26 +08:00 committed by GUIDINGLI
parent df6505567c
commit d39ed19213

View file

@ -139,6 +139,9 @@ function(nuttx_add_application)
set(TARGET "ELF_${TARGET}")
add_library(${TARGET} ${SRCS})
add_dependencies(${TARGET} apps_post)
if(TARGET STARTUP_OBJS)
add_dependencies(${TARGET} STARTUP_OBJS)
endif()
if(NOT "${CMAKE_LD}" MATCHES "gcc$")
set(USE_LINKER True)
endif()