mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 05:55:46 +08:00
cmake(enhance):add target we can dump all CMake lib targets
`cmake --build -t dump_targets` list all lib target current generator need to build Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
This commit is contained in:
@@ -62,6 +62,12 @@ function(nuttx_add_library_internal target)
|
|||||||
|
|
||||||
# Set install config for all library
|
# Set install config for all library
|
||||||
install(TARGETS ${target})
|
install(TARGETS ${target})
|
||||||
|
# Set target information for debug and dump
|
||||||
|
set_property(
|
||||||
|
TARGET nuttx_target_interface
|
||||||
|
APPEND
|
||||||
|
PROPERTY ALL_TARGETS ${target})
|
||||||
|
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/targets "${target}\n")
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
# Auxiliary libraries
|
# Auxiliary libraries
|
||||||
|
|||||||
@@ -28,6 +28,10 @@ include(nuttx_parse_function_args)
|
|||||||
# compiler options and include path needed by all apps libraries.
|
# compiler options and include path needed by all apps libraries.
|
||||||
add_custom_target(nuttx_apps_interface)
|
add_custom_target(nuttx_apps_interface)
|
||||||
|
|
||||||
|
# "nuttx_target_interface" is a source-less target that hold target information
|
||||||
|
# for target debug and dump
|
||||||
|
add_custom_target(nuttx_target_interface)
|
||||||
|
|
||||||
# Macro: nuttx_library
|
# Macro: nuttx_library
|
||||||
#
|
#
|
||||||
# Creates a library target with the given name and mode. If MODE is "KERNEL", it
|
# Creates a library target with the given name and mode. If MODE is "KERNEL", it
|
||||||
@@ -298,3 +302,14 @@ function(nuttx_link_libraries)
|
|||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
# dump targets information
|
||||||
|
add_custom_target(
|
||||||
|
dump_targets
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E remove target_dump
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E echo
|
||||||
|
"'$<TARGET_PROPERTY:nuttx_target_interface,ALL_TARGETS>'"
|
||||||
|
COMMAND
|
||||||
|
${CMAKE_COMMAND} -E echo
|
||||||
|
"'$<TARGET_PROPERTY:nuttx_target_interface,ALL_TARGETS>'" >> target_dump
|
||||||
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||||
|
|||||||
Reference in New Issue
Block a user