diff --git a/cmake/nuttx_generate_headers.cmake b/cmake/nuttx_generate_headers.cmake index b4a2049e47..af12b4352a 100644 --- a/cmake/nuttx_generate_headers.cmake +++ b/cmake/nuttx_generate_headers.cmake @@ -49,8 +49,13 @@ if(NOT EXISTS ${CMAKE_BINARY_DIR}/include/arch) endif() if(NOT EXISTS ${CMAKE_BINARY_DIR}/include_arch/arch/board) - nuttx_create_symlink(${NUTTX_BOARD_DIR}/include - ${CMAKE_BINARY_DIR}/include_arch/arch/board) + if(EXISTS ${NUTTX_BOARD_DIR}/include) + nuttx_create_symlink(${NUTTX_BOARD_DIR}/include + ${CMAKE_BINARY_DIR}/include_arch/arch/board) + elseif(EXISTS ${NUTTX_BOARD_DIR}/../common/include) + nuttx_create_symlink(${NUTTX_BOARD_DIR}/../common/include + ${CMAKE_BINARY_DIR}/include_arch/arch/board) + endif() endif() if(NOT EXISTS ${CMAKE_BINARY_DIR}/include_arch/arch/chip)