cmake(enhance):enhance NuttX cmake target dependencies and link_library modules

Enhance CMake's add_dependencies for Nuttx so that
different targets can call dependencies without errors when they are not traversed.

In addition, since we do not call link_library directly,
we increment nuttx_link_library to inherit the PUBLIC property

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
This commit is contained in:
xuxin19
2024-11-21 15:44:22 +08:00
committed by Alan C. Assis
parent a1cbed020a
commit cfe78ad74e
5 changed files with 134 additions and 13 deletions

View File

@@ -365,6 +365,10 @@ nuttx_export_kconfig(${CMAKE_BINARY_DIR}/.config)
include(nuttx_generate_headers)
include(nuttx_generate_outputs)
include(nuttx_add_library)
# add NuttX CMake extenstion after nuttx_add_library
include(nuttx_extensions)
include(nuttx_add_application)
include(nuttx_add_romfs)
include(nuttx_add_symtab)
@@ -378,9 +382,6 @@ include(menuconfig)
include(ExternalProject)
include(FetchContent)
# add NuttX CMake extenstion at last
include(nuttx_extensions)
set(FETCHCONTENT_QUIET OFF)
# Board common directory #####################################################
@@ -582,6 +583,9 @@ if(NOT CONFIG_BUILD_KERNEL)
endif()
# after we traverse all build directories unify all target dependencies
process_all_target_dependencies()
# Link step ##################################################################
# Get linker script to use