mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-08-29 05:16:22 +00:00
This forms the foundation for the abstraction of the binary tools, where the following steps are taken: - Move binary tool resolving, such as objcopy, objdump, readelf and so forth, out of compiler definitions and place in a dedicated binary tools folder with the binary tools supplier as subfolder, similar to the compiler and linker directories. - Create binary tool sets, gnu, host-gnu and llvm. - Each toolchain selects the required set of binary tools by setting BINTOOLS via its generic.cmake as it also does for compiler and linker. The intent here is to abstract Zephyr's dependence on toolchains, thus allowing for easier porting to other, perhaps commercial, toolchains and/or usecases. No functional change expected. Signed-off-by: Danny Oerndrup <daor@demant.com>
31 lines
1.1 KiB
CMake
31 lines
1.1 KiB
CMake
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# Until we completely deprecate it
|
|
if(NOT DEFINED ENV{GNUARMEMB_TOOLCHAIN_PATH})
|
|
if(DEFINED ENV{GCCARMEMB_TOOLCHAIN_PATH})
|
|
message(WARNING "GCCARMEMB_TOOLCHAIN_PATH is deprecated, please use GNUARMEMB_TOOLCHAIN_PATH instead")
|
|
set(GNUARMEMB_TOOLCHAIN_PATH $ENV{GCCARMEMB_TOOLCHAIN_PATH})
|
|
endif()
|
|
endif()
|
|
|
|
set_ifndef(GNUARMEMB_TOOLCHAIN_PATH "$ENV{GNUARMEMB_TOOLCHAIN_PATH}")
|
|
set( GNUARMEMB_TOOLCHAIN_PATH ${GNUARMEMB_TOOLCHAIN_PATH} CACHE PATH "gnuarmemb install directory")
|
|
assert( GNUARMEMB_TOOLCHAIN_PATH "GNUARMEMB_TOOLCHAIN_PATH is not set")
|
|
|
|
if(NOT EXISTS ${GNUARMEMB_TOOLCHAIN_PATH})
|
|
message(FATAL_ERROR "Nothing found at GNUARMEMB_TOOLCHAIN_PATH: '${GNUARMEMB_TOOLCHAIN_PATH}'")
|
|
endif()
|
|
|
|
set(TOOLCHAIN_HOME ${GNUARMEMB_TOOLCHAIN_PATH})
|
|
|
|
set(COMPILER gcc)
|
|
set(LINKER ld)
|
|
set(BINTOOLS gnu)
|
|
|
|
set(CROSS_COMPILE_TARGET arm-none-eabi)
|
|
set(SYSROOT_TARGET arm-none-eabi)
|
|
|
|
set(CROSS_COMPILE ${TOOLCHAIN_HOME}/bin/${CROSS_COMPILE_TARGET}-)
|
|
set(SYSROOT_DIR ${TOOLCHAIN_HOME}/${SYSROOT_TARGET})
|
|
set(TOOLCHAIN_HAS_NEWLIB ON CACHE BOOL "True if toolchain supports newlib")
|