px4_add_board:Add Optional LINKER_PREFIX

This commit is contained in:
David Sidrane 2020-02-26 13:46:30 -08:00 committed by David Sidrane
parent 3ed643f3d7
commit e12bce3a20
2 changed files with 13 additions and 0 deletions

View File

@ -57,6 +57,7 @@
# [ SERIAL_PORTS <list> ]
# [ CONSTRAINED_FLASH ]
# [ TESTING ]
# [ LINKER_PREFIX <string> ]
# )
#
# Input:
@ -78,6 +79,7 @@
# SERIAL_PORTS : mapping of user configurable serial ports and param facing name
# CONSTRAINED_FLASH : flag to enable constrained flash options (eg limit init script status text)
# TESTING : flag to enable automatic inclusion of PX4 testing modules
# LINKER_PREFIX : optional to prefix on the Linker script.
#
#
# Example:
@ -140,6 +142,7 @@ function(px4_add_board)
IO
BOOTLOADER
UAVCAN_INTERFACES
LINKER_PREFIX
MULTI_VALUE
DRIVERS
MODULES
@ -229,6 +232,12 @@ function(px4_add_board)
set(PX4_TESTING "1" CACHE INTERNAL "testing enabled" FORCE)
endif()
if(LINKER_PREFIX)
set(PX4_BOARD_LINKER_PREFIX ${LINKER_PREFIX} CACHE STRING "PX4 board linker prefix" FORCE)
else()
set(PX4_BOARD_LINKER_PREFIX "" CACHE STRING "PX4 board linker prefix" FORCE)
endif()
include(px4_impl_os)
px4_os_prebuild_targets(OUT prebuild_targets BOARD ${PX4_BOARD})

View File

@ -60,6 +60,10 @@ if("${PX4_BOARD_LABEL}" STREQUAL "bootloader")
bootloader_lib
drivers_board
)
else()
if(NOT "${PX4_BOARD_LINKER_PREFIX}" STREQUAL "")
set(SCRIPT_PREFIX ${PX4_BOARD_LINKER_PREFIX}-)
endif()
endif()
list(APPEND nuttx_libs