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 tools as host GNU binutils
|
|
|
|
|
|
|
|
find_program(CMAKE_OBJCOPY objcopy)
|
|
|
|
find_program(CMAKE_OBJDUMP objdump)
|
|
|
|
find_program(CMAKE_AR ar )
|
|
|
|
find_program(CMAKE_RANLILB ranlib )
|
|
|
|
find_program(CMAKE_READELF readelf)
|
|
|
|
|
|
|
|
find_program(CMAKE_GDB gdb )
|
2019-07-18 21:16:39 +08:00
|
|
|
|
|
|
|
# Use the gnu binutil abstraction macros
|
|
|
|
include(${ZEPHYR_BASE}/cmake/bintools/gnu/target_memusage.cmake)
|
2019-08-01 13:56:45 +08:00
|
|
|
include(${ZEPHYR_BASE}/cmake/bintools/gnu/target_objcopy.cmake)
|
2019-08-01 14:01:39 +08:00
|
|
|
include(${ZEPHYR_BASE}/cmake/bintools/gnu/target_objdump.cmake)
|