cmake: Set TOOLCHAIN_HOME for Zephyr's SDK

Host-tools don't unconditionally set TOOLCHAIN_HOME anymore,
but in case Zephyr's SDK toolchain is used, set TOOLCHAIN_HOME.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
This commit is contained in:
Oleg Zhurakivskyy 2019-03-08 14:52:11 +02:00 committed by Anas Nashif
parent de603c0c78
commit 274a4a28df
1 changed files with 5 additions and 0 deletions

View File

@ -41,6 +41,11 @@ if("${ZEPHYR_TOOLCHAIN_VARIANT}" STREQUAL "gccarmemb")
set(ZEPHYR_TOOLCHAIN_VARIANT "gnuarmemb")
endif()
# Host-tools don't unconditionally set TOOLCHAIN_HOME anymore,
# but in case Zephyr's SDK toolchain is used, set TOOLCHAIN_HOME
if("${ZEPHYR_TOOLCHAIN_VARIANT}" STREQUAL "zephyr")
set(TOOLCHAIN_HOME ${HOST_TOOLS_HOME})
endif()
set(TOOLCHAIN_ROOT ${TOOLCHAIN_ROOT} CACHE STRING "Zephyr toolchain root")
assert(TOOLCHAIN_ROOT "Zephyr toolchain root path invalid: please set the TOOLCHAIN_ROOT-variable")