mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 15:13:34 +08:00
Cleanup of module building.
This commit is contained in:
@@ -1,30 +1,29 @@
|
||||
# a list of modules that will be linked to main
|
||||
set(module_list)
|
||||
set(module_list
|
||||
platforms__nuttx
|
||||
platforms__nuttx__px4_layer
|
||||
platforms__common
|
||||
drivers__led
|
||||
drivers__device
|
||||
modules__systemlib
|
||||
modules__uORB
|
||||
)
|
||||
|
||||
if (${LABEL} STREQUAL "simple")
|
||||
list(APPEND module_list
|
||||
drivers__led
|
||||
drivers__device
|
||||
platforms__common
|
||||
modules__systemlib
|
||||
modules__uORB
|
||||
examples__px4_simple_app
|
||||
lib__mathlib__math__filter
|
||||
lib__conversion
|
||||
)
|
||||
endif()
|
||||
|
||||
if (${LABEL} STREQUAL "simple")
|
||||
list(APPEND module_list ${module_list_simple})
|
||||
if(${BOARD} STREQUAL "px4fmu-v2")
|
||||
list(APPEND module_list
|
||||
drivers__boards__px4fmu-v2
|
||||
drivers__stm32
|
||||
lib__mathlib__math__filter
|
||||
lib__conversion
|
||||
)
|
||||
endif()
|
||||
|
||||
list(APPEND module_list
|
||||
platforms__nuttx
|
||||
platforms__nuttx__px4_layer
|
||||
drivers__boards__px4fmu-v2
|
||||
drivers__stm32
|
||||
)
|
||||
|
||||
px4_nuttx_generate_builtin_commands(
|
||||
OUT builtin_commands.c
|
||||
MODULE_LIST ${module_list})
|
||||
|
||||
@@ -1,21 +1,8 @@
|
||||
include(px4_base)
|
||||
|
||||
set(module_dir_list)
|
||||
set(module_list)
|
||||
px4_posix_add_modules(module_dir_list ${BOARD})
|
||||
message(STATUS "module list: ${module_dir_list}")
|
||||
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
foreach(directory ${module_dir_list})
|
||||
message(STATUS "directory: ${directory}")
|
||||
px4_mangle_name(${directory} mangled_name)
|
||||
list(APPEND module_list
|
||||
${mangled_name})
|
||||
endforeach()
|
||||
px4_posix_generate_builtin_commands(
|
||||
OUT apps.h
|
||||
MODULE_LIST ${module_list})
|
||||
MODULE_LIST ${module_libraries})
|
||||
|
||||
add_executable(mainapp
|
||||
${CMAKE_SOURCE_DIR}/src/platforms/posix/main.cpp
|
||||
@@ -30,7 +17,7 @@ set_target_properties(mainapp PROPERTIES LINK_FLAGS ${main_link_flags})
|
||||
|
||||
target_link_libraries(mainapp
|
||||
-Wl,--start-group
|
||||
${module_list}
|
||||
${module_libraries}
|
||||
pthread m
|
||||
-Wl,--end-group
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user