# SPDX-License-Identifier: Apache-2.0

set_ifndef(ARCMWDT_TOOLCHAIN_PATH "$ENV{ARCMWDT_TOOLCHAIN_PATH}")
set(ARCMWDT_TOOLCHAIN_PATH ${ARCMWDT_TOOLCHAIN_PATH} CACHE PATH "mwdt tools install directory")
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()

set(TOOLCHAIN_HOME ${ARCMWDT_TOOLCHAIN_PATH}/MetaWare)

set(COMPILER arcmwdt)
set(LINKER arcmwdt)
set(BINTOOLS arcmwdt)

set(SYSROOT_TARGET arc)

set(CROSS_COMPILE ${TOOLCHAIN_HOME}/arc/bin/)
set(SYSROOT_DIR ${TOOLCHAIN_HOME}/${SYSROOT_TARGET})

set(TOOLCHAIN_HAS_NEWLIB OFF CACHE BOOL "True if toolchain supports newlib")
