ARC: ARCMWDT: check METAWARE_ROOT if ARCMWDT_TOOLCHAIN_PATH missing

ARC MWDT toolchain installation provides METAWARE_ROOT environment
variable. Let's check METAWARE_ROOT environment variable if
zephyr-specific option ARCMWDT_TOOLCHAIN_PATH missing.

That improves user experience.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
This commit is contained in:
Evgeniy Paltsev 2023-03-29 22:51:36 +01:00 committed by Carles Cufí
parent 06c6a9cb1c
commit 1f57517e2c

View file

@ -1,6 +1,16 @@
# SPDX-License-Identifier: Apache-2.0
zephyr_get(ARCMWDT_TOOLCHAIN_PATH)
if(NOT DEFINED ARCMWDT_TOOLCHAIN_PATH AND DEFINED ENV{METAWARE_ROOT})
message(WARNING "ARCMWDT_TOOLCHAIN_PATH is not set, use default toolchain from METAWARE_ROOT")
set(METAWARE_ROOT $ENV{METAWARE_ROOT})
if(NOT EXISTS ${METAWARE_ROOT})
message(FATAL_ERROR "Nothing found at METAWARE_ROOT: '${METAWARE_ROOT}'")
endif()
cmake_path(GET METAWARE_ROOT PARENT_PATH ARCMWDT_TOOLCHAIN_PATH)
endif()
assert(ARCMWDT_TOOLCHAIN_PATH "ARCMWDT_TOOLCHAIN_PATH is not set")
if(NOT EXISTS ${ARCMWDT_TOOLCHAIN_PATH})