cmake(feat):implements KERNEL mode in CMake build

1.add application link dependencies for all elf
2.add a global custom target to hold proptry in the toolchain file
3.add startup obj target
4.fix cpp lds error with kernel mod link elf lds

usage:
./build.sh qemu-armv7a:knsh --cmake
elf install in ${CMAKE_BINARY_DIR}/bin

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
This commit is contained in:
xuxin19
2025-02-18 21:23:27 +08:00
committed by GUIDINGLI
parent a2d2a49ba9
commit b7582b8da1
8 changed files with 66 additions and 15 deletions
+9
View File
@@ -49,4 +49,13 @@ if(CONFIG_LIBC_ELF)
target_sources(c PRIVATE ${SRCS})
set(ELF_LD_SCRIPT_TMP "${CMAKE_BINARY_DIR}/gnu-elf.ld")
nuttx_generate_preprocess_target(
SOURCE_FILE ${NUTTX_DIR}/libs/libc/elf/gnu-elf.ld.in TARGET_FILE
${ELF_LD_SCRIPT_TMP})
add_custom_target(elfldscript_tmp DEPENDS ${ELF_LD_SCRIPT_TMP})
add_dependencies(nuttx elfldscript_tmp)
endif()