uavcan:Build system specify architecture

This commit is contained in:
David Sidrane
2018-08-14 09:38:15 -04:00
committed by Daniel Agar
parent 0c3386d255
commit caa0700ca3
+18 -7
View File
@@ -34,21 +34,32 @@
px4_add_git_submodule(TARGET git_uavcan PATH "libuavcan") px4_add_git_submodule(TARGET git_uavcan PATH "libuavcan")
set(UAVCAN_USE_CPP03 ON CACHE BOOL "uavcan cpp03") 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) if(NOT config_uavcan_num_ifaces)
message(FATAL_ERROR "config_uavcan_num_ifaces not set") message(FATAL_ERROR "config_uavcan_num_ifaces not set")
endif() endif()
string(TOUPPER "${OS}" OS_UPPER) string(TOUPPER "${OS}" OS_UPPER)
string(TOUPPER "${UAVCAN_PLATFORM}" UAVCAN_PLATFORM_UPPER)
add_definitions( add_definitions(
-DUAVCAN_CPP_VERSION=UAVCAN_CPP03 -DUAVCAN_CPP_VERSION=UAVCAN_CPP03
-DUAVCAN_MEM_POOL_BLOCK_SIZE=48 -DUAVCAN_MEM_POOL_BLOCK_SIZE=48
-DUAVCAN_NO_ASSERTIONS -DUAVCAN_NO_ASSERTIONS
-DUAVCAN_PLATFORM=stm32 -DUAVCAN_PLATFORM=${UAVCAN_PLATFORM}
-DUAVCAN_STM32_${OS_UPPER}=1 -DUAVCAN_DRIVER=uavcan_${UAVCAN_PLATFORM}
-DUAVCAN_STM32_NUM_IFACES=${config_uavcan_num_ifaces} -DUAVCAN_${UAVCAN_PLATFORM_UPPER}_${OS_UPPER}=1
-DUAVCAN_STM32_TIMER_NUMBER=5 -DUAVCAN_${UAVCAN_PLATFORM_UPPER}_NUM_IFACES=${config_uavcan_num_ifaces}
-DUAVCAN_${UAVCAN_PLATFORM_UPPER}_TIMER_NUMBER=${UAVCAN_TIMER}
) )
add_subdirectory(libuavcan EXCLUDE_FROM_ALL) add_subdirectory(libuavcan EXCLUDE_FROM_ALL)
@@ -64,7 +75,7 @@ px4_add_module(
libuavcan/libuavcan/include libuavcan/libuavcan/include
libuavcan/libuavcan/include/dsdlc_generated libuavcan/libuavcan/include/dsdlc_generated
libuavcan/libuavcan_drivers/posix/include libuavcan/libuavcan_drivers/posix/include
libuavcan/libuavcan_drivers/stm32/driver/include libuavcan/libuavcan_drivers/${UAVCAN_PLATFORM}/driver/include
SRCS SRCS
# Main # Main
uavcan_main.cpp uavcan_main.cpp
@@ -89,5 +100,5 @@ px4_add_module(
# within libuavcan # within libuavcan
libuavcan_dsdlc libuavcan_dsdlc
uavcan uavcan
uavcan_stm32_driver uavcan_${UAVCAN_PLATFORM}_driver
) )