mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 07:53:35 +08:00
boards/modalai: separate voxl2 builds into two board builds instead of single board build with different variants
* Made voxl2 apps processor and slpi dsp processor builds into separate board builds so that they can more easily be configured independently. * Removed board specific link library command from px4_config.cmake and moved it to a more generic board specific solution that can be used by any board that needs custom link libraries. * Removed redundant cmake command for Qurt * Removed unused definition from Qurt cmake file * Removed unnecessary QURT_LIB cmake function * Reorganized the voxl2 build structure to avoid 4 level board directories. * Reverted cmake files to remove 4 level board naming code * Updated documentation
This commit is contained in:
@@ -97,18 +97,14 @@ if(EXISTS "${PX4_BOARD_DIR}/cmake/upload.cmake")
|
||||
include(${PX4_BOARD_DIR}/cmake/upload.cmake)
|
||||
endif()
|
||||
|
||||
# board defined link libraries
|
||||
if(EXISTS "${PX4_BOARD_DIR}/cmake/link_libraries.cmake")
|
||||
include(${PX4_BOARD_DIR}/cmake/link_libraries.cmake)
|
||||
endif()
|
||||
|
||||
if("${PX4_BOARD}" MATCHES "beaglebone_blue")
|
||||
target_link_libraries(px4 PRIVATE robotics_cape)
|
||||
|
||||
elseif("${PX4_BOARD}" MATCHES "modalai_voxl2")
|
||||
# libfc_sensor.so is provided in the Docker build environment
|
||||
target_link_libraries(px4 PRIVATE
|
||||
/home/libfc_sensor.so
|
||||
px4_layer
|
||||
${module_libraries}
|
||||
)
|
||||
|
||||
elseif("${PX4_BOARD}" MATCHES "emlid_navio2")
|
||||
target_link_libraries(px4 PRIVATE atomic)
|
||||
|
||||
|
||||
@@ -33,11 +33,16 @@
|
||||
|
||||
get_property(module_libraries GLOBAL PROPERTY PX4_MODULE_LIBRARIES)
|
||||
|
||||
QURT_LIB(LIB_NAME px4
|
||||
SOURCES
|
||||
${PX4_SOURCE_DIR}/platforms/qurt/unresolved_symbols.c
|
||||
LINK_LIBS
|
||||
modules__muorb__slpi
|
||||
${module_libraries}
|
||||
px4_layer
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
add_library(px4 SHARED
|
||||
${PX4_SOURCE_DIR}/platforms/qurt/unresolved_symbols.c
|
||||
)
|
||||
|
||||
target_link_libraries(px4
|
||||
modules__muorb__slpi
|
||||
${module_libraries}
|
||||
px4_layer
|
||||
)
|
||||
|
||||
@@ -31,6 +31,29 @@
|
||||
#
|
||||
############################################################################
|
||||
|
||||
if ("$ENV{HEXAGON_SDK_ROOT}" STREQUAL "")
|
||||
message(FATAL_ERROR "Enviroment variable HEXAGON_SDK_ROOT must be set")
|
||||
else()
|
||||
set(HEXAGON_SDK_ROOT $ENV{HEXAGON_SDK_ROOT})
|
||||
endif()
|
||||
|
||||
if ("$ENV{HEXAGON_TOOLS_ROOT}" STREQUAL "")
|
||||
message(FATAL_ERROR "Environment variable HEXAGON_TOOLS_ROOT must be set")
|
||||
else()
|
||||
set(HEXAGON_TOOLS_ROOT $ENV{HEXAGON_TOOLS_ROOT})
|
||||
endif()
|
||||
|
||||
include(px4_git)
|
||||
|
||||
include(Toolchain-qurt)
|
||||
include(qurt_reqs)
|
||||
|
||||
include_directories(${HEXAGON_SDK_INCLUDES})
|
||||
|
||||
add_definitions(-DORB_COMMUNICATOR)
|
||||
|
||||
set(DISABLE_PARAMS_MODULE_SCOPING TRUE)
|
||||
|
||||
#=============================================================================
|
||||
#
|
||||
# Defined functions in this file
|
||||
|
||||
@@ -176,46 +176,3 @@ list2string(CMAKE_EXE_LINKER_FLAGS
|
||||
)
|
||||
|
||||
include (CMakeParseArguments)
|
||||
|
||||
# Process DSP files
|
||||
function (QURT_LIB)
|
||||
set(options)
|
||||
set(oneValueArgs LIB_NAME)
|
||||
set(multiValueArgs SOURCES LINK_LIBS INCS FLAGS)
|
||||
cmake_parse_arguments(QURT_LIB "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
if ("${QURT_LIB_SOURCES}" STREQUAL "")
|
||||
message(FATAL_ERROR "QURT_LIB called without SOURCES")
|
||||
else()
|
||||
# Build lib that is run on the DSP
|
||||
add_library(${QURT_LIB_LIB_NAME} SHARED
|
||||
${QURT_LIB_SOURCES}
|
||||
)
|
||||
|
||||
if (NOT "${QURT_LIB_FLAGS}" STREQUAL "")
|
||||
set_target_properties(${QURT_LIB_LIB_NAME} PROPERTIES COMPILE_FLAGS "${QURT_LIB_FLAGS}")
|
||||
endif()
|
||||
|
||||
if (NOT "${QURT_LIB_INCS}" STREQUAL "")
|
||||
target_include_directories(${QURT_LIB_LIB_NAME} PUBLIC ${QURT_LIB_INCS})
|
||||
endif()
|
||||
|
||||
target_link_libraries(${QURT_LIB_LIB_NAME}
|
||||
${QURT_LIB_LINK_LIBS}
|
||||
)
|
||||
endif()
|
||||
|
||||
set(DSPLIB_TARGET_PATH "/usr/lib/rfsa/adsp/")
|
||||
|
||||
# Add a rule to load the files onto the target that run in the DSP
|
||||
add_custom_target(lib${QURT_LIB_LIB_NAME}-load
|
||||
DEPENDS ${QURT_LIB_LIB_NAME}
|
||||
COMMAND adb wait-for-device
|
||||
COMMAND adb push lib${QURT_LIB_LIB_NAME}.so ${DSPLIB_TARGET_PATH}
|
||||
COMMAND echo "Pushed lib${QURT_LIB_LIB_NAME}.so and dependencies to ${DSPLIB_TARGET_PATH}"
|
||||
)
|
||||
endfunction()
|
||||
|
||||
Reference in New Issue
Block a user