mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
uavcan:Build system specify architecture
This commit is contained in:
parent
0c3386d255
commit
caa0700ca3
@ -34,21 +34,32 @@
|
||||
px4_add_git_submodule(TARGET git_uavcan PATH "libuavcan")
|
||||
|
||||
set(UAVCAN_USE_CPP03 ON CACHE BOOL "uavcan cpp03")
|
||||
set(UAVCAN_PLATFORM stm32 CACHE STRING "uavcan platform")
|
||||
|
||||
# The default is the stm32
|
||||
if(NOT UAVCAN_PLATFORM)
|
||||
set(UAVCAN_PLATFORM stm32 CACHE STRING "uavcan platform")
|
||||
endif()
|
||||
|
||||
# The default timer the 5
|
||||
if(NOT UAVCAN_TIMER)
|
||||
set(UAVCAN_TIMER 5)
|
||||
endif()
|
||||
|
||||
if(NOT config_uavcan_num_ifaces)
|
||||
message(FATAL_ERROR "config_uavcan_num_ifaces not set")
|
||||
endif()
|
||||
|
||||
string(TOUPPER "${OS}" OS_UPPER)
|
||||
string(TOUPPER "${UAVCAN_PLATFORM}" UAVCAN_PLATFORM_UPPER)
|
||||
add_definitions(
|
||||
-DUAVCAN_CPP_VERSION=UAVCAN_CPP03
|
||||
-DUAVCAN_MEM_POOL_BLOCK_SIZE=48
|
||||
-DUAVCAN_NO_ASSERTIONS
|
||||
-DUAVCAN_PLATFORM=stm32
|
||||
-DUAVCAN_STM32_${OS_UPPER}=1
|
||||
-DUAVCAN_STM32_NUM_IFACES=${config_uavcan_num_ifaces}
|
||||
-DUAVCAN_STM32_TIMER_NUMBER=5
|
||||
-DUAVCAN_PLATFORM=${UAVCAN_PLATFORM}
|
||||
-DUAVCAN_DRIVER=uavcan_${UAVCAN_PLATFORM}
|
||||
-DUAVCAN_${UAVCAN_PLATFORM_UPPER}_${OS_UPPER}=1
|
||||
-DUAVCAN_${UAVCAN_PLATFORM_UPPER}_NUM_IFACES=${config_uavcan_num_ifaces}
|
||||
-DUAVCAN_${UAVCAN_PLATFORM_UPPER}_TIMER_NUMBER=${UAVCAN_TIMER}
|
||||
)
|
||||
|
||||
add_subdirectory(libuavcan EXCLUDE_FROM_ALL)
|
||||
@ -64,7 +75,7 @@ px4_add_module(
|
||||
libuavcan/libuavcan/include
|
||||
libuavcan/libuavcan/include/dsdlc_generated
|
||||
libuavcan/libuavcan_drivers/posix/include
|
||||
libuavcan/libuavcan_drivers/stm32/driver/include
|
||||
libuavcan/libuavcan_drivers/${UAVCAN_PLATFORM}/driver/include
|
||||
SRCS
|
||||
# Main
|
||||
uavcan_main.cpp
|
||||
@ -89,5 +100,5 @@ px4_add_module(
|
||||
# within libuavcan
|
||||
libuavcan_dsdlc
|
||||
uavcan
|
||||
uavcan_stm32_driver
|
||||
uavcan_${UAVCAN_PLATFORM}_driver
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user