cmake: rework of target toolchain handling

Follow-up: #41301

This commit is a rework and cleanup of the target toolchain handling in
Zephyr CMake build system.

Instead of directly loading code a CMake modules for target toolchain
lookup, the target toolchain now follows the CMake `find_package()`
pattern for finding the target toolchain.

This makes it more clear which modules are responsible for finding tools
and which modules provides build integration / features.

The following tools can now be found using `find_package()`:
- Target toolchain: find_package(TargetTools)

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit is contained in:
Torsten Rasmussen 2022-08-30 11:11:36 +02:00 committed by Carles Cufí
commit 7131d02fa4
3 changed files with 31 additions and 2 deletions

View file

@ -85,7 +85,6 @@ list(APPEND zephyr_cmake_modules "\${pre_dt_board}")
list(APPEND zephyr_cmake_modules dts)
list(APPEND zephyr_cmake_modules kconfig)
list(APPEND zephyr_cmake_modules soc)
list(APPEND zephyr_cmake_modules target_toolchain)
foreach(component ${SUB_COMPONENTS})
if(NOT ${component} IN_LIST zephyr_cmake_modules)