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})