diff --git a/boards/aerotenna/ocpoc/ubuntu.cmake b/boards/aerotenna/ocpoc/ubuntu.cmake index 72cbaf19bc..6ff23cb5f1 100644 --- a/boards/aerotenna/ocpoc/ubuntu.cmake +++ b/boards/aerotenna/ocpoc/ubuntu.cmake @@ -5,7 +5,7 @@ px4_add_board( LABEL ubuntu PLATFORM posix ARCH cortex-a9 - TOOLCHAIN Toolchain-arm-linux-gnueabihf + TOOLCHAIN arm-linux-gnueabihf TESTING DRIVERS diff --git a/boards/airmind/mindpx-v2/default.cmake b/boards/airmind/mindpx-v2/default.cmake index 5efb53b359..cd902639e1 100644 --- a/boards/airmind/mindpx-v2/default.cmake +++ b/boards/airmind/mindpx-v2/default.cmake @@ -3,6 +3,7 @@ px4_add_board( PLATFORM nuttx VENDOR airmind MODEL mindpx-v2 + TOOLCHAIN arm-none-eabi ARCH cortex-m4 ROMFS ROMFSROOT px4fmu_common diff --git a/boards/atlflight/eagle/default.cmake b/boards/atlflight/eagle/default.cmake index 7a6fa1573c..963a88078c 100644 --- a/boards/atlflight/eagle/default.cmake +++ b/boards/atlflight/eagle/default.cmake @@ -3,7 +3,10 @@ include(px4_git) px4_add_git_submodule(TARGET git_cmake_hexagon PATH "${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon") -list(APPEND CMAKE_MODULE_PATH "${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon") +list(APPEND CMAKE_MODULE_PATH + "${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon" + "${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon/toolchain" + ) # Get $QC_SOC_TARGET from environment if existing. if (DEFINED ENV{QC_SOC_TARGET}) @@ -32,8 +35,7 @@ px4_add_board( MODEL eagle LABEL default TESTING - TOOLCHAIN - toolchain/Toolchain-arm-linux-gnueabihf + TOOLCHAIN arm-linux-gnueabihf DRIVERS #barometer # all available barometer drivers diff --git a/boards/atlflight/excelsior/default.cmake b/boards/atlflight/excelsior/default.cmake index 10b66aa1cf..2732f8cfbf 100644 --- a/boards/atlflight/excelsior/default.cmake +++ b/boards/atlflight/excelsior/default.cmake @@ -3,7 +3,10 @@ include(px4_git) px4_add_git_submodule(TARGET git_cmake_hexagon PATH "${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon") -list(APPEND CMAKE_MODULE_PATH "${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon") +list(APPEND CMAKE_MODULE_PATH + "${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon" + "${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon/toolchain" + ) # Get $QC_SOC_TARGET from environment if existing. if (DEFINED ENV{QC_SOC_TARGET}) @@ -32,8 +35,7 @@ px4_add_board( MODEL excelsior LABEL default TESTING - TOOLCHAIN - toolchain/Toolchain-arm-oemllib32-linux-gnueabi + TOOLCHAIN arm-oemllib32-linux-gnueabi DRIVERS #barometer # all available barometer drivers diff --git a/boards/atlflight/excelsior/qurt-default.cmake b/boards/atlflight/excelsior/qurt-default.cmake index 7840eae554..4e6c0beff3 100644 --- a/boards/atlflight/excelsior/qurt-default.cmake +++ b/boards/atlflight/excelsior/qurt-default.cmake @@ -1,3 +1,4 @@ + # Excelsior is the code name of a board currently in development. # # This cmake config builds for QURT which is the operating system running on diff --git a/boards/auav/esc35-v1/default.cmake b/boards/auav/esc35-v1/default.cmake index f99e4bd815..78a9866b77 100644 --- a/boards/auav/esc35-v1/default.cmake +++ b/boards/auav/esc35-v1/default.cmake @@ -40,6 +40,7 @@ px4_add_board( PLATFORM nuttx VENDOR auav MODEL esc35-v1 + TOOLCHAIN arm-none-eabi ARCH cortex-m4 DRIVERS diff --git a/boards/auav/x21/default.cmake b/boards/auav/x21/default.cmake index 75878f4218..ea6c4e50de 100644 --- a/boards/auav/x21/default.cmake +++ b/boards/auav/x21/default.cmake @@ -4,6 +4,7 @@ px4_add_board( VENDOR auav MODEL x21 LABEL default + TOOLCHAIN arm-none-eabi ARCH cortex-m4 ROMFS ROMFSROOT px4fmu_common diff --git a/boards/beaglebone/blue/cross.cmake b/boards/beaglebone/blue/cross.cmake index b94d2670d8..e965a5c9c2 100644 --- a/boards/beaglebone/blue/cross.cmake +++ b/boards/beaglebone/blue/cross.cmake @@ -5,7 +5,7 @@ px4_add_board( LABEL cross PLATFORM posix ARCH cortex-a8 - TOOLCHAIN Toolchain-arm-linux-gnueabihf + TOOLCHAIN arm-linux-gnueabihf TESTING DRIVERS diff --git a/boards/beaglebone/blue/native.cmake b/boards/beaglebone/blue/native.cmake index 8cf471663e..74d4ed2a43 100644 --- a/boards/beaglebone/blue/native.cmake +++ b/boards/beaglebone/blue/native.cmake @@ -4,7 +4,6 @@ px4_add_board( MODEL blue LABEL native PLATFORM posix - TOOLCHAIN Toolchain-native TESTING DRIVERS diff --git a/boards/bitcraze/crazyflie/default.cmake b/boards/bitcraze/crazyflie/default.cmake index 0cbd417131..20be2ae54a 100644 --- a/boards/bitcraze/crazyflie/default.cmake +++ b/boards/bitcraze/crazyflie/default.cmake @@ -3,6 +3,7 @@ px4_add_board( PLATFORM nuttx VENDOR bitcraze MODEL crazyflie + TOOLCHAIN arm-none-eabi ARCH cortex-m4 ROMFS ROMFSROOT px4fmu_common diff --git a/boards/emlid/navio2/cross.cmake b/boards/emlid/navio2/cross.cmake index d2da059530..9d05574eab 100644 --- a/boards/emlid/navio2/cross.cmake +++ b/boards/emlid/navio2/cross.cmake @@ -5,7 +5,7 @@ px4_add_board( LABEL cross PLATFORM posix ARCH cortex-a53 - TOOLCHAIN Toolchain-arm-linux-gnueabihf + TOOLCHAIN arm-linux-gnueabihf TESTING DRIVERS diff --git a/boards/emlid/navio2/native.cmake b/boards/emlid/navio2/native.cmake index c435f6b3cf..1a6243ea8b 100644 --- a/boards/emlid/navio2/native.cmake +++ b/boards/emlid/navio2/native.cmake @@ -4,7 +4,6 @@ px4_add_board( MODEL navio2 LABEL native PLATFORM posix - TOOLCHAIN Toolchain-native TESTING DRIVERS diff --git a/boards/gumstix/aerocore2/default.cmake b/boards/gumstix/aerocore2/default.cmake index b672ab98d9..bffbfad408 100644 --- a/boards/gumstix/aerocore2/default.cmake +++ b/boards/gumstix/aerocore2/default.cmake @@ -3,6 +3,7 @@ px4_add_board( PLATFORM nuttx VENDOR gumstix MODEL aerocore2 + TOOLCHAIN arm-none-eabi ARCH cortex-m4 ROMFS ROMFSROOT px4fmu_common diff --git a/boards/intel/aerofc-v1/default.cmake b/boards/intel/aerofc-v1/default.cmake index 2517a8187d..30a62eeafe 100644 --- a/boards/intel/aerofc-v1/default.cmake +++ b/boards/intel/aerofc-v1/default.cmake @@ -3,6 +3,7 @@ px4_add_board( PLATFORM nuttx VENDOR intel MODEL aerofc-v1 + TOOLCHAIN arm-none-eabi ARCH cortex-m4 ROMFS ROMFSROOT px4fmu_common diff --git a/boards/intel/aerofc-v1/rtps.cmake b/boards/intel/aerofc-v1/rtps.cmake index d5f76d4172..b378ee790b 100644 --- a/boards/intel/aerofc-v1/rtps.cmake +++ b/boards/intel/aerofc-v1/rtps.cmake @@ -4,6 +4,7 @@ px4_add_board( VENDOR intel MODEL aerofc-v1 LABEL rtsp + TOOLCHAIN arm-none-eabi ARCH cortex-m4 ROMFS ROMFSROOT px4fmu_common diff --git a/boards/nxp/hlite-v3/default.cmake b/boards/nxp/hlite-v3/default.cmake index 2299590e33..048dc95bb5 100644 --- a/boards/nxp/hlite-v3/default.cmake +++ b/boards/nxp/hlite-v3/default.cmake @@ -3,6 +3,7 @@ px4_add_board( PLATFORM nuttx VENDOR nxp MODEL hlite-v3 + TOOLCHAIN arm-none-eabi ARCH cortex-m4 ROMFS ROMFSROOT px4fmu_common diff --git a/boards/omnibus/f4sd/default.cmake b/boards/omnibus/f4sd/default.cmake index c65106130c..6d7e9d8758 100644 --- a/boards/omnibus/f4sd/default.cmake +++ b/boards/omnibus/f4sd/default.cmake @@ -3,6 +3,7 @@ px4_add_board( PLATFORM nuttx VENDOR omnibus MODEL f4sd + TOOLCHAIN arm-none-eabi ARCH cortex-m4 ROMFS ROMFSROOT px4fmu_common diff --git a/boards/parrot/bebop/default.cmake b/boards/parrot/bebop/default.cmake index ca5c60b567..38a2700e91 100644 --- a/boards/parrot/bebop/default.cmake +++ b/boards/parrot/bebop/default.cmake @@ -4,7 +4,7 @@ px4_add_board( MODEL bebop PLATFORM posix ARCH cortex-a53 - TOOLCHAIN Toolchain-arm-linux-gnueabihf + TOOLCHAIN arm-linux-gnueabihf DRIVERS gps diff --git a/boards/px4/cannode-v1/default.cmake b/boards/px4/cannode-v1/default.cmake index 31874d98b9..47954b5eb0 100644 --- a/boards/px4/cannode-v1/default.cmake +++ b/boards/px4/cannode-v1/default.cmake @@ -38,6 +38,7 @@ px4_add_board( PLATFORM nuttx VENDOR px4 MODEL cannode-v1 + TOOLCHAIN arm-none-eabi ARCH cortex-m3 DRIVERS diff --git a/boards/px4/esc-v1/default.cmake b/boards/px4/esc-v1/default.cmake index 416f635424..6986faba35 100644 --- a/boards/px4/esc-v1/default.cmake +++ b/boards/px4/esc-v1/default.cmake @@ -40,6 +40,7 @@ px4_add_board( PLATFORM nuttx VENDOR px4 MODEL esc-v1 + TOOLCHAIN arm-none-eabi ARCH cortex-m4 DRIVERS diff --git a/boards/px4/fmu-v2/default.cmake b/boards/px4/fmu-v2/default.cmake index d437b560f3..1381fc3801 100644 --- a/boards/px4/fmu-v2/default.cmake +++ b/boards/px4/fmu-v2/default.cmake @@ -4,6 +4,7 @@ px4_add_board( VENDOR px4 MODEL fmu-v2 LABEL default + TOOLCHAIN arm-none-eabi ARCH cortex-m4 ROMFS ROMFSROOT px4fmu_common diff --git a/boards/px4/fmu-v2/lpe.cmake b/boards/px4/fmu-v2/lpe.cmake index 9bb6134251..f955e67dac 100644 --- a/boards/px4/fmu-v2/lpe.cmake +++ b/boards/px4/fmu-v2/lpe.cmake @@ -4,6 +4,7 @@ px4_add_board( VENDOR px4 MODEL fmu-v2 LABEL lpe + TOOLCHAIN arm-none-eabi ARCH cortex-m4 ROMFS ROMFSROOT px4fmu_common diff --git a/boards/px4/fmu-v2/test.cmake b/boards/px4/fmu-v2/test.cmake index fb5af393bc..0980f10484 100644 --- a/boards/px4/fmu-v2/test.cmake +++ b/boards/px4/fmu-v2/test.cmake @@ -4,6 +4,7 @@ px4_add_board( VENDOR px4 MODEL fmu-v2 LABEL test + TOOLCHAIN arm-none-eabi ARCH cortex-m4 ROMFS ROMFSROOT px4fmu_test diff --git a/boards/px4/fmu-v3/default.cmake b/boards/px4/fmu-v3/default.cmake index 7bb815c8b6..35383a3d86 100644 --- a/boards/px4/fmu-v3/default.cmake +++ b/boards/px4/fmu-v3/default.cmake @@ -6,6 +6,7 @@ px4_add_board( VENDOR px4 MODEL fmu-v3 LABEL default + TOOLCHAIN arm-none-eabi ARCH cortex-m4 ROMFS ROMFSROOT px4fmu_common diff --git a/boards/px4/fmu-v3/rtps.cmake b/boards/px4/fmu-v3/rtps.cmake index aa5e1da25f..5ad7ecdda0 100644 --- a/boards/px4/fmu-v3/rtps.cmake +++ b/boards/px4/fmu-v3/rtps.cmake @@ -6,6 +6,7 @@ px4_add_board( VENDOR px4 MODEL fmu-v3 LABEL rtps + TOOLCHAIN arm-none-eabi ARCH cortex-m4 ROMFS ROMFSROOT px4fmu_common diff --git a/boards/px4/fmu-v3/stackcheck.cmake b/boards/px4/fmu-v3/stackcheck.cmake index 6de1839325..8c3a5f8661 100644 --- a/boards/px4/fmu-v3/stackcheck.cmake +++ b/boards/px4/fmu-v3/stackcheck.cmake @@ -6,6 +6,7 @@ px4_add_board( VENDOR px4 MODEL fmu-v3 LABEL stackcheck + TOOLCHAIN arm-none-eabi ARCH cortex-m4 ROMFS ROMFSROOT px4fmu_common diff --git a/boards/px4/fmu-v4/default.cmake b/boards/px4/fmu-v4/default.cmake index 5019b220b1..3bee7be83b 100644 --- a/boards/px4/fmu-v4/default.cmake +++ b/boards/px4/fmu-v4/default.cmake @@ -4,6 +4,7 @@ px4_add_board( VENDOR px4 MODEL fmu-v4 LABEL default + TOOLCHAIN arm-none-eabi ARCH cortex-m4 ROMFS ROMFSROOT px4fmu_common diff --git a/boards/px4/fmu-v4/rtps.cmake b/boards/px4/fmu-v4/rtps.cmake index 0c2521aef0..b54a7af292 100644 --- a/boards/px4/fmu-v4/rtps.cmake +++ b/boards/px4/fmu-v4/rtps.cmake @@ -4,6 +4,7 @@ px4_add_board( VENDOR px4 MODEL fmu-v4 LABEL rtps + TOOLCHAIN arm-none-eabi ARCH cortex-m4 ROMFS ROMFSROOT px4fmu_common diff --git a/boards/px4/fmu-v4/stackcheck.cmake b/boards/px4/fmu-v4/stackcheck.cmake index c41cee1348..d993ccb172 100644 --- a/boards/px4/fmu-v4/stackcheck.cmake +++ b/boards/px4/fmu-v4/stackcheck.cmake @@ -4,6 +4,7 @@ px4_add_board( VENDOR px4 MODEL fmu-v4 LABEL stackcheck + TOOLCHAIN arm-none-eabi ARCH cortex-m4 ROMFS ROMFSROOT px4fmu_common diff --git a/boards/px4/fmu-v4pro/default.cmake b/boards/px4/fmu-v4pro/default.cmake index be45096474..5b3adc6126 100644 --- a/boards/px4/fmu-v4pro/default.cmake +++ b/boards/px4/fmu-v4pro/default.cmake @@ -4,6 +4,7 @@ px4_add_board( VENDOR px4 MODEL fmu-v4pro LABEL default + TOOLCHAIN arm-none-eabi ARCH cortex-m4 ROMFS ROMFSROOT px4fmu_common diff --git a/boards/px4/fmu-v4pro/rtps.cmake b/boards/px4/fmu-v4pro/rtps.cmake index ac57d4debf..54d94adc59 100644 --- a/boards/px4/fmu-v4pro/rtps.cmake +++ b/boards/px4/fmu-v4pro/rtps.cmake @@ -4,6 +4,7 @@ px4_add_board( VENDOR px4 MODEL fmu-v4pro LABEL default + TOOLCHAIN arm-none-eabi ARCH cortex-m4 ROMFS ROMFSROOT px4fmu_common diff --git a/boards/px4/io-v2/default.cmake b/boards/px4/io-v2/default.cmake index e855de0a61..c9094a09cc 100644 --- a/boards/px4/io-v2/default.cmake +++ b/boards/px4/io-v2/default.cmake @@ -3,6 +3,7 @@ px4_add_board( PLATFORM nuttx VENDOR px4 MODEL io-v2 + TOOLCHAIN arm-none-eabi ARCH cortex-m3 DRIVERS stm32 diff --git a/boards/px4/raspberrypi/native.cmake b/boards/px4/raspberrypi/native.cmake index 7b2256704d..3da49dbe5b 100644 --- a/boards/px4/raspberrypi/native.cmake +++ b/boards/px4/raspberrypi/native.cmake @@ -4,7 +4,6 @@ px4_add_board( MODEL raspberrypi LABEL native PLATFORM posix - TOOLCHAIN Toolchain-native TESTING DRIVERS diff --git a/boards/stm/32f4discovery/default.cmake b/boards/stm/32f4discovery/default.cmake index 01be6afbb5..442e38da76 100644 --- a/boards/stm/32f4discovery/default.cmake +++ b/boards/stm/32f4discovery/default.cmake @@ -3,6 +3,7 @@ px4_add_board( PLATFORM nuttx VENDOR stm MODEL 32f4discovery + TOOLCHAIN arm-none-eabi ARCH cortex-m4 ROMFS ROMFSROOT px4fmu_common diff --git a/boards/thiemar/s2740vc-v1/default.cmake b/boards/thiemar/s2740vc-v1/default.cmake index 5202e28eb6..fba3e644d5 100644 --- a/boards/thiemar/s2740vc-v1/default.cmake +++ b/boards/thiemar/s2740vc-v1/default.cmake @@ -31,6 +31,7 @@ px4_add_board( PLATFORM nuttx VENDOR thiemar MODEL s2740vc-v1 + TOOLCHAIN arm-none-eabi ARCH cortex-m4 DRIVERS diff --git a/cmake/px4_add_board.cmake b/cmake/px4_add_board.cmake index 02f0e94958..f7e8618d4f 100644 --- a/cmake/px4_add_board.cmake +++ b/cmake/px4_add_board.cmake @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (c) 2017 PX4 Development Team. All rights reserved. +# Copyright (c) 2018 PX4 Development Team. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -31,15 +31,6 @@ # ############################################################################ -#============================================================================= -# -# Defined functions in this file -# -# utility functions -# -# * px4_add_board -# - include(px4_base) #============================================================================= @@ -128,7 +119,7 @@ function(px4_add_board) endif() if(TOOLCHAIN) - set(CMAKE_TOOLCHAIN_FILE ${TOOLCHAIN} CACHE INTERNAL "toolchain file" FORCE) + set(CMAKE_TOOLCHAIN_FILE Toolchain-${TOOLCHAIN} CACHE INTERNAL "toolchain file" FORCE) endif() if(BOOTLOADER) @@ -139,10 +130,40 @@ function(px4_add_board) set(board_serial_ports ${SERIAL_PORTS} PARENT_SCOPE) endif() - include(px4_add_board_os) - px4_add_board_os(${ARGV}) + # ROMFS + if(ROMFS) + if (PX4_PLATFORM MATCHES "NuttX" AND NOT DEFINED ROMFSROOT) + set(config_romfs_root px4fmu_common) + else() + set(config_romfs_root ${ROMFSROOT}) + endif() + set(config_romfs_root ${config_romfs_root} CACHE INTERNAL "ROMFS root" FORCE) + endif() + + # IO board (placed in ROMFS) + if(IO) + set(config_io_board ${IO} CACHE INTERNAL "IO" FORCE) + endif() + + if(UAVCAN_INTERFACES) + set(config_uavcan_num_ifaces ${UAVCAN_INTERFACES} CACHE INTERNAL "UAVCAN interfaces" FORCE) + endif() + + # OPTIONS + + if(CONSTRAINED_FLASH) + set(px4_constrained_flash_build "1" CACHE INTERNAL "constrained flash build" FORCE) + endif() + + if(TESTING) + set(PX4_TESTING "1" CACHE INTERNAL "testing enabled" FORCE) + endif() + + include(px4_impl_os) + px4_os_prebuild_targets(OUT prebuild_targets BOARD ${PX4_BOARD}) + ########################################################################### # Modules (includes drivers, examples, modules, systemcmds) set(config_module_list) @@ -187,14 +208,4 @@ function(px4_add_board) set(config_module_list ${config_module_list} PARENT_SCOPE) - # OPTIONS - - if(CONSTRAINED_FLASH) - set(px4_constrained_flash_build "1" CACHE INTERNAL "constrained flash build" FORCE) - endif() - - if(TESTING) - set(PX4_TESTING "1" CACHE INTERNAL "testing enabled" FORCE) - endif() - endfunction() diff --git a/platforms/nuttx/cmake/px4_add_board_os.cmake b/platforms/nuttx/cmake/px4_add_board_os.cmake deleted file mode 100644 index f38c027b70..0000000000 --- a/platforms/nuttx/cmake/px4_add_board_os.cmake +++ /dev/null @@ -1,130 +0,0 @@ -############################################################################ -# -# Copyright (c) 2018 PX4 Development Team. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# 3. Neither the name PX4 nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -############################################################################ - -#============================================================================= -# -# Defined functions in this file -# -# utility functions -# -# * px4_add_board_os -# - -include(px4_base) - -#============================================================================= -# -# px4_add_board_os -# -# This function creates a PX4 board. -# -# Usage: -# px4_add_board_os( -# BOARD -# OS -# [ TOOLCHAIN ] -# ) -# -# Input: -# BOARD : name of board -# OS : posix, nuttx, qurt -# -# -# Example: -# px4_add_board_os( -# BOARD px4_fmu-v2_default -# OS nuttx -# ) -# -function(px4_add_board_os) - - px4_parse_function_args( - NAME px4_add_board_os - ONE_VALUE - VENDOR - MODEL - LABEL - BOARD_OVERRIDE - PLATFORM - TOOLCHAIN - ARCH - ROMFSROOT - IO - BOOTLOADER - UAVCAN_INTERFACES - MULTI_VALUE - DRIVERS - MODULES - SYSTEMCMDS - EXAMPLES - SERIAL_PORTS - DF_DRIVERS # DriverFramework drivers - OPTIONS - CONSTRAINED_FLASH - ROMFS - TESTING - ARGN ${ARGN}) - - if(NOT CMAKE_TOOLCHAIN_FILE) - set(CMAKE_TOOLCHAIN_FILE Toolchain-arm-none-eabi CACHE INTERNAL "toolchain file" FORCE) - endif() - - if(LABEL MATCHES "stackcheck") - set(NUTTX_CONFIG "stackcheck" CACHE INTERNAL "NuttX config" FORCE) - else() - set(NUTTX_CONFIG "nsh" CACHE INTERNAL "NuttX config" FORCE) - endif() - - # ROMFS - if(ROMFS) - if (NOT DEFINED ROMFSROOT) - set(config_romfs_root px4fmu_common) - else() - set(config_romfs_root ${ROMFSROOT}) - endif() - set(config_romfs_root ${config_romfs_root} CACHE INTERNAL "ROMFS root" FORCE) - endif() - - # IO board placed in ROMFS - if(IO) - set(config_io_board ${IO} CACHE INTERNAL "IO" FORCE) - endif() - - if(UAVCAN_INTERFACES) - set(config_uavcan_num_ifaces ${UAVCAN_INTERFACES} CACHE INTERNAL "UAVCAN interfaces" FORCE) - endif() - - include(px4_impl_os) - px4_os_prebuild_targets(OUT prebuild_targets BOARD ${PX4_BOARD}) - -endfunction() diff --git a/platforms/nuttx/cmake/px4_impl_os.cmake b/platforms/nuttx/cmake/px4_impl_os.cmake index 5210465a20..8879b9933a 100644 --- a/platforms/nuttx/cmake/px4_impl_os.cmake +++ b/platforms/nuttx/cmake/px4_impl_os.cmake @@ -168,6 +168,12 @@ function(px4_os_prebuild_targets) REQUIRED OUT ARGN ${ARGN}) + if(PX4_BOARD_LABEL MATCHES "stackcheck") + set(NUTTX_CONFIG "stackcheck" CACHE INTERNAL "NuttX config" FORCE) + else() + set(NUTTX_CONFIG "nsh" CACHE INTERNAL "NuttX config" FORCE) + endif() + add_library(prebuild_targets INTERFACE) target_link_libraries(prebuild_targets INTERFACE nuttx_cxx nuttx_c nuttx_fs nuttx_mm nuttx_sched m gcc) add_dependencies(prebuild_targets DEPENDS nuttx_context uorb_headers) diff --git a/platforms/posix/cmake/px4_add_board_os.cmake b/platforms/posix/cmake/px4_add_board_os.cmake deleted file mode 100644 index 90f06f5ce2..0000000000 --- a/platforms/posix/cmake/px4_add_board_os.cmake +++ /dev/null @@ -1,106 +0,0 @@ -############################################################################ -# -# Copyright (c) 2018 PX4 Development Team. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# 3. Neither the name PX4 nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -############################################################################ - -#============================================================================= -# -# Defined functions in this file -# -# utility functions -# -# * px4_add_board_os -# - -include(px4_base) - -#============================================================================= -# -# px4_add_board_os -# -# This function creates a PX4 board. -# -# Usage: -# px4_add_board_os( -# BOARD -# OS -# [ TOOLCHAIN ] -# ) -# -# Input: -# BOARD : name of board -# OS : posix, nuttx, qurt -# -# -# Example: -# px4_add_board_os( -# BOARD px4_fmu-v2_default -# OS nuttx -# ) -# -function(px4_add_board_os) - - px4_parse_function_args( - NAME px4_add_board_os - ONE_VALUE - VENDOR - MODEL - LABEL - PLATFORM - TOOLCHAIN - ARCH - ROMFSROOT - IO - BOOTLOADER - UAVCAN_INTERFACES - MULTI_VALUE - DRIVERS - MODULES - SYSTEMCMDS - EXAMPLES - SERIAL_PORTS - DF_DRIVERS # DriverFramework drivers - OPTIONS - CONSTRAINED_FLASH - ROMFS - TESTING - REQUIRED - ARGN ${ARGN}) - - if(NOT CMAKE_TOOLCHAIN_FILE) - # default to native toolchain - set(CMAKE_TOOLCHAIN_FILE Toolchain-native CACHE INTERNAL "toolchain file" FORCE) - endif() - - include(px4_impl_os) - px4_os_prebuild_targets(OUT prebuild_targets BOARD ${PX4_BOARD}) - -endfunction() diff --git a/platforms/qurt/cmake/px4_add_board_os.cmake b/platforms/qurt/cmake/px4_add_board_os.cmake deleted file mode 100644 index f9db97ce3b..0000000000 --- a/platforms/qurt/cmake/px4_add_board_os.cmake +++ /dev/null @@ -1,101 +0,0 @@ -############################################################################ -# -# Copyright (c) 2018 PX4 Development Team. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# 3. Neither the name PX4 nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -############################################################################ - -#============================================================================= -# -# Defined functions in this file -# -# utility functions -# -# * px4_add_board_os -# - -include(px4_base) - -#============================================================================= -# -# px4_add_board_os -# -# This function creates a PX4 board. -# -# Usage: -# px4_add_board_os( -# BOARD -# OS -# [ TOOLCHAIN ] -# ) -# -# Input: -# BOARD : name of board -# OS : posix, nuttx, qurt -# -# -# Example: -# px4_add_board_os( -# BOARD px4_fmu-v2_default -# OS nuttx -# ) -# -function(px4_add_board_os) - - px4_parse_function_args( - NAME px4_add_board_os - ONE_VALUE - VENDOR - MODEL - LABEL - PLATFORM - TOOLCHAIN - ARCH - ROMFSROOT - IO - BOOTLOADER - UAVCAN_INTERFACES - MULTI_VALUE - DRIVERS - MODULES - SYSTEMCMDS - EXAMPLES - SERIAL_PORTS - DF_DRIVERS # DriverFramework drivers - OPTIONS - CONSTRAINED_FLASH - ROMFS - TESTING - REQUIRED - ARGN ${ARGN}) - - include(px4_impl_os) - px4_os_prebuild_targets(OUT prebuild_targets BOARD ${PX4_BOARD}) - -endfunction()