cmake: toolchain: zephyr-0.10.0: Fix setting of SYSROOT_DIR on xtensa

We need to set SYSROOT_DIR as the last thing we do on target.cmake so
we reset how its set for xtensa.  Otherwise when we build with newlib
we will not get the proper path to newlib headers in the toolchain.

This matches the behavior of 0.9.5/target.cmake

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2019-02-20 18:48:46 -06:00 committed by Anas Nashif
parent 2270f4b116
commit 830ec0285c

View file

@ -16,7 +16,6 @@ set(CROSS_COMPILE_TARGET ${CROSS_COMPILE_TARGET_${ARCH}})
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})
@ -28,3 +27,4 @@ if("${ARCH}" STREQUAL "xtensa")
LIST(APPEND TOOLCHAIN_LIBS hal)
LIST(APPEND LIB_INCLUDE_DIR -L${SYSROOT_DIR}/lib)
endif()
set(SYSROOT_DIR ${TOOLCHAIN_HOME}/${SYSROOT_TARGET}/${SYSROOT_TARGET})