2019-04-06 15:08:09 +02:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2023-02-25 01:46:36 +01:00
|
|
|
# Purpose of the generic.cmake is to define a generic C compiler which can be
|
|
|
|
# used for devicetree pre-processing and other pre-processing tasks which must
|
|
|
|
# be performed before the target can be determined.
|
|
|
|
|
2022-07-14 15:44:53 +02:00
|
|
|
# Todo: deprecate CLANG_ROOT_DIR
|
2020-10-29 13:53:01 +01:00
|
|
|
set_ifndef(LLVM_TOOLCHAIN_PATH "$ENV{CLANG_ROOT_DIR}")
|
2022-07-14 15:44:53 +02:00
|
|
|
zephyr_get(LLVM_TOOLCHAIN_PATH)
|
|
|
|
|
2020-10-29 13:53:01 +01:00
|
|
|
if(LLVM_TOOLCHAIN_PATH)
|
|
|
|
set(TOOLCHAIN_HOME ${LLVM_TOOLCHAIN_PATH}/bin/)
|
2019-03-08 12:04:13 +01:00
|
|
|
endif()
|
2018-12-10 15:14:50 +01:00
|
|
|
|
2020-10-29 13:53:01 +01:00
|
|
|
set(LLVM_TOOLCHAIN_PATH ${CLANG_ROOT_DIR} CACHE PATH "clang install directory")
|
|
|
|
|
2018-05-02 07:09:31 +02:00
|
|
|
set(COMPILER clang)
|
cmake: Toolchain abstraction: Abstraction of binary tools, foundation.
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>
2019-07-18 15:06:51 +02:00
|
|
|
set(BINTOOLS llvm)
|
2018-05-02 07:09:31 +02:00
|
|
|
|
2021-04-19 16:12:42 +02:00
|
|
|
set(TOOLCHAIN_HAS_NEWLIB OFF CACHE BOOL "True if toolchain supports newlib")
|
2020-03-05 23:20:59 +01:00
|
|
|
|
|
|
|
message(STATUS "Found toolchain: host (clang/ld)")
|