zephyr/cmake/toolchain/arcmwdt/generic.cmake
Wayne Ren b868018b51 cmake: add metaware toolchain support in build system
* add metaware toolchain support in build system:
   * compiler
   * linker
   * binutils
     * gcc objcopy is used because it can't be replaced
       with mwdt's binutils currently
* To use ARC metaware toolchain, you'd better:
   * in Linux/Unix environment
   * install arc gcc/zephyr toolchain to use gnu's objcopy
     tool
   * set ZEPHYR_TOOLCHAIN_VARIANT=arcmwdt

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2020-09-05 10:22:56 -05:00

23 lines
736 B
CMake

# 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")