diff --git a/cmake/toolchain/xtools/target.cmake b/cmake/toolchain/xtools/target.cmake index b3f6e79b665..9bcaec2a3b8 100644 --- a/cmake/toolchain/xtools/target.cmake +++ b/cmake/toolchain/xtools/target.cmake @@ -17,3 +17,14 @@ set(SYSROOT_TARGET ${CROSS_COMPILE_TARGET}) set(CROSS_COMPILE ${TOOLCHAIN_HOME}/${CROSS_COMPILE_TARGET}/bin/${CROSS_COMPILE_TARGET}-) set(SYSROOT_DIR ${TOOLCHAIN_HOME}/${SYSROOT_TARGET}/${SYSROOT_TARGET}) + +if("${ARCH}" STREQUAL "xtensa") + set(SYSROOT_DIR ${TOOLCHAIN_HOME}/${SYSROOT_TARGET}) + set(TOOLCHAIN_INCLUDES + ${SYSROOT_DIR}/include/arch/include + ${SYSROOT_DIR}/include + ) + + LIST(APPEND TOOLCHAIN_LIBS hal) + LIST(APPEND LIB_INCLUDE_DIR -L${SYSROOT_DIR}/lib) +endif()