mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-08-14 12:25:28 +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>
30 lines
935 B
CMake
30 lines
935 B
CMake
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# CROSS_COMPILE is a KBuild mechanism for specifying an external
|
|
# toolchain with a single environment variable.
|
|
#
|
|
# It is a legacy mechanism that will in Zephyr translate to
|
|
# specififying ZEPHYR_TOOLCHAIN_VARIANT to 'cross-compile' with the location
|
|
# 'CROSS_COMPILE'.
|
|
#
|
|
# New users should set the env var 'ZEPHYR_TOOLCHAIN_VARIANT' to
|
|
# 'cross-compile' and the 'CROSS_COMPILE' env var to the toolchain
|
|
# prefix. This interface is consistent with the other non-"Zephyr SDK"
|
|
# toolchains.
|
|
#
|
|
# It can be set from either the environment or from a CMake variable
|
|
# of the same name.
|
|
#
|
|
# The env var has the lowest precedence.
|
|
|
|
if((NOT (DEFINED CROSS_COMPILE)) AND (DEFINED ENV{CROSS_COMPILE}))
|
|
set(CROSS_COMPILE $ENV{CROSS_COMPILE})
|
|
endif()
|
|
|
|
set( CROSS_COMPILE ${CROSS_COMPILE} CACHE PATH "")
|
|
assert(CROSS_COMPILE "CROSS_COMPILE is not set")
|
|
|
|
set(COMPILER gcc)
|
|
set(LINKER ld)
|
|
set(BINTOOLS gnu)
|