From c75bf5ebc504dc655c4c94c60edf55b4ea013b27 Mon Sep 17 00:00:00 2001 From: Evgeniy Paltsev Date: Tue, 20 Jun 2023 08:46:06 +0100 Subject: [PATCH] ARC: MWDT: cleanup search path handling Cleanup ARC MWDT search path handling: * Don't print warning if ARCMWDT_TOOLCHAIN_PATH is missing but METAWARE_ROOT is set. Treat it as valid case and do message with status level instead of warning. * Make rest of the error messages more understandable for users. Signed-off-by: Eugeniy Paltsev Signed-off-by: Evgeniy Paltsev --- cmake/toolchain/arcmwdt/generic.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmake/toolchain/arcmwdt/generic.cmake b/cmake/toolchain/arcmwdt/generic.cmake index ddd517770a2..3f5fded2dac 100644 --- a/cmake/toolchain/arcmwdt/generic.cmake +++ b/cmake/toolchain/arcmwdt/generic.cmake @@ -2,17 +2,17 @@ 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}) +set(METAWARE_ROOT $ENV{METAWARE_ROOT}) +if(NOT DEFINED ARCMWDT_TOOLCHAIN_PATH AND DEFINED METAWARE_ROOT) + message(STATUS "ARCMWDT_TOOLCHAIN_PATH is not set, use default toolchain from METAWARE_ROOT: '${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) +elseif(NOT DEFINED ARCMWDT_TOOLCHAIN_PATH AND NOT DEFINED METAWARE_ROOT) + message(FATAL_ERROR "No MWDT toolchain specified: neither ARCMWDT_TOOLCHAIN_PATH nor METAWARE_ROOT defined") endif() -assert(ARCMWDT_TOOLCHAIN_PATH "ARCMWDT_TOOLCHAIN_PATH is not set") - if(NOT EXISTS ${ARCMWDT_TOOLCHAIN_PATH}) message(FATAL_ERROR "Nothing found at ARCMWDT_TOOLCHAIN_PATH: '${ARCMWDT_TOOLCHAIN_PATH}'") endif()