mirror of
https://github.com/apache/nuttx.git
synced 2026-03-24 07:35:07 +08:00
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 <xuxin19@xiaomi.com>
This commit is contained in:
@@ -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)
|
||||
$<TARGET_OBJECTS:STARTUP_OBJS> --start-group
|
||||
$<GENEX_EVAL:$<TARGET_PROPERTY:nuttx_global,NUTTX_ELF_LINK_LIBRARIES>>
|
||||
$<TARGET_FILE:${TARGET}> --end-group -o
|
||||
${CMAKE_BINARY_DIR}/bin/${TARGET}
|
||||
${CMAKE_BINARY_DIR}/bin/${ELF_NAME}
|
||||
COMMAND_EXPAND_LISTS)
|
||||
else()
|
||||
add_executable(${TARGET} ${SRCS})
|
||||
|
||||
Reference in New Issue
Block a user