2020-11-30 15:59:18 +08:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2022-07-14 21:44:53 +08:00
|
|
|
zephyr_get(ARMCLANG_TOOLCHAIN_PATH)
|
2020-11-30 15:59:18 +08:00
|
|
|
assert(ARMCLANG_TOOLCHAIN_PATH "ARMCLANG_TOOLCHAIN_PATH is not set")
|
|
|
|
|
2021-08-14 05:24:11 +08:00
|
|
|
if(${CMAKE_VERSION} VERSION_LESS 3.21
|
|
|
|
AND NOT ${CMAKE_GENERATOR} STREQUAL Ninja
|
|
|
|
)
|
|
|
|
message(FATAL_ERROR "ARMClang Toolchain and '${CMAKE_GENERATOR}' generator "
|
|
|
|
"doesn't work properly for target object files on CMake version: "
|
|
|
|
"${CMAKE_VERSION}. Use the 'Ninja' generator or update to CMake >= 3.21."
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2020-11-30 15:59:18 +08:00
|
|
|
if(NOT EXISTS ${ARMCLANG_TOOLCHAIN_PATH})
|
|
|
|
message(FATAL_ERROR "Nothing found at ARMCLANG_TOOLCHAIN_PATH: '${ARMCLANG_TOOLCHAIN_PATH}'")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(TOOLCHAIN_HOME ${ARMCLANG_TOOLCHAIN_PATH})
|
|
|
|
|
|
|
|
set(COMPILER armclang)
|
|
|
|
set(LINKER armlink)
|
|
|
|
set(BINTOOLS armclang)
|
|
|
|
|
|
|
|
set(SYSROOT_TARGET arm)
|
|
|
|
|
|
|
|
set(CROSS_COMPILE ${TOOLCHAIN_HOME}/bin/)
|
|
|
|
|
|
|
|
set(TOOLCHAIN_HAS_NEWLIB OFF CACHE BOOL "True if toolchain supports newlib")
|