cmake:adapt the header file symbolic link to the common directory

fix `board.h` is not set correctly when using cmake to compile a board with common directory

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
This commit is contained in:
xuxin19 2024-02-22 17:05:52 +08:00 committed by Xiang Xiao
parent 7c1de0a347
commit 1b7ddab317
1 changed files with 7 additions and 2 deletions

View File

@ -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)