Skip to content

Commit

Permalink
cmake: NuttX check that CONFIG_ARCH_BOARD_CUSTOM_DIR is in PX4_BOARD_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
dagar committed May 9, 2022
1 parent 5d6c8c9 commit 15296ab
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions platforms/nuttx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ endif()
# build NuttX
add_subdirectory(NuttX ${PX4_BINARY_DIR}/NuttX)

# check that CONFIG_ARCH_BOARD_CUSTOM_DIR is in PX4_BOARD_DIR
if(CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH)
get_filename_component(nuttx_defconfig_root "${NUTTX_DEFCONFIG}/../.." ABSOLUTE)
get_filename_component(nuttx_config_from_defconfig "${NUTTX_DIR}/${CONFIG_ARCH_BOARD_CUSTOM_DIR}" ABSOLUTE)

if(NOT ${nuttx_defconfig_root} MATCHES ${nuttx_config_from_defconfig})
message(FATAL_ERROR "NuttX custom board directory (${CONFIG_ARCH_BOARD_CUSTOM_DIR}) isn't in board directory (${PX4_BOARD_DIR})")
endif()
endif()

set(nuttx_libs)
set(SCRIPT_PREFIX)
if("${PX4_BOARD_LABEL}" STREQUAL "bootloader")
Expand Down

0 comments on commit 15296ab

Please sign in to comment.