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 21:06:51 +08:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
# Configures binary toos as llvm binary tool set
|
|
|
|
|
|
|
|
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_AR llvm-ar ${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})
|
2019-07-18 21:16:39 +08:00
|
|
|
|
|
|
|
# Use the gnu binutil abstraction macros
|
|
|
|
include(${ZEPHYR_BASE}/cmake/bintools/gnu/target_memusage.cmake)
|