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>
This commit is contained in:
parent
b8af1a6a4e
commit
aed9ea79b5
18 changed files with 57 additions and 41 deletions
|
@ -13,20 +13,10 @@ endif()
|
|||
|
||||
if(DEFINED TOOLCHAIN_HOME)
|
||||
set(find_program_clang_args PATH ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
|
||||
set(find_program_binutils_args PATH ${TOOLCHAIN_HOME})
|
||||
endif()
|
||||
|
||||
|
||||
find_program(CMAKE_C_COMPILER clang ${find_program_clang_args})
|
||||
find_program(CMAKE_CXX_COMPILER clang++ ${find_program_clang_args})
|
||||
find_program(CMAKE_AR llvm-ar ${find_program_clang_args})
|
||||
find_program(CMAKE_LINKER llvm-link ${find_program_clang_args})
|
||||
find_program(CMAKE_NM llvm-nm ${find_program_clang_args})
|
||||
find_program(CMAKE_OBJDUMP llvm-objdump ${find_program_clang_args})
|
||||
find_program(CMAKE_RANLIB llvm-ranlib ${find_program_clang_args})
|
||||
|
||||
find_program(CMAKE_OBJCOPY objcopy ${find_program_binutils_args})
|
||||
find_program(CMAKE_READELF readelf ${find_program_binutils_args})
|
||||
find_program(CMAKE_C_COMPILER clang ${find_program_clang_args})
|
||||
find_program(CMAKE_CXX_COMPILER clang++ ${find_program_clang_args})
|
||||
|
||||
if(NOT "${ARCH}" STREQUAL "posix")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue