From 885ff780c5a59971b690d83c08fe8ad98bc5d433 Mon Sep 17 00:00:00 2001 From: xuxin19 Date: Thu, 6 Mar 2025 16:06:55 +0800 Subject: [PATCH] cmake(bugfix):fix KERNEL mod elf target dup with lib target Using the same name as elf may lead to duplicate errors. Signed-off-by: xuxin19 --- cmake/nuttx_add_application.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/nuttx_add_application.cmake b/cmake/nuttx_add_application.cmake index 2dee999c248..2e95a9f4fb7 100644 --- a/cmake/nuttx_add_application.cmake +++ b/cmake/nuttx_add_application.cmake @@ -116,6 +116,8 @@ function(nuttx_add_application) # Use ELF capable toolchain, by building manually and overwriting the # non-elf output if(NOT CMAKE_C_ELF_COMPILER) + set(ELF_NAME "${NAME}") + set(TARGET "ELF_${TARGET}") add_library(${TARGET} ${SRCS}) add_dependencies(${TARGET} apps_post) add_custom_command( @@ -128,7 +130,7 @@ function(nuttx_add_application) $ --start-group $> $ --end-group -o - ${CMAKE_BINARY_DIR}/bin/${TARGET} + ${CMAKE_BINARY_DIR}/bin/${ELF_NAME} COMMAND_EXPAND_LISTS) else() add_executable(${TARGET} ${SRCS})