cmake: move CMAKE_<lang>_COMPILER_FORCED into toolchain code.

To prepare for more modular approach move the compiler forced out of
boilerplate and into the specific toolchain cmake code (generic/target).

Code is added to both generic and target toolchain modules to allow
future use of one module without requiring a load of the other module.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit is contained in:
Torsten Rasmussen 2021-12-16 10:05:20 +01:00 committed by Marti Bolivar
parent 254e35d61d
commit de34b67c45
3 changed files with 8 additions and 4 deletions

View file

@ -477,10 +477,6 @@ if(NOT DEFINED USER_CACHE_DIR)
endif() endif()
message(STATUS "Cache files will be written to: ${USER_CACHE_DIR}") message(STATUS "Cache files will be written to: ${USER_CACHE_DIR}")
# Prevent CMake from testing the toolchain
set(CMAKE_C_COMPILER_FORCED 1)
set(CMAKE_CXX_COMPILER_FORCED 1)
include(${ZEPHYR_BASE}/cmake/verify-toolchain.cmake) include(${ZEPHYR_BASE}/cmake/verify-toolchain.cmake)
include(${ZEPHYR_BASE}/cmake/host-tools.cmake) include(${ZEPHYR_BASE}/cmake/host-tools.cmake)

View file

@ -1,5 +1,9 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# Prevent CMake from testing the toolchain
set(CMAKE_C_COMPILER_FORCED 1)
set(CMAKE_CXX_COMPILER_FORCED 1)
if(NOT TOOLCHAIN_ROOT) if(NOT TOOLCHAIN_ROOT)
if(DEFINED ENV{TOOLCHAIN_ROOT}) if(DEFINED ENV{TOOLCHAIN_ROOT})
# Support for out-of-tree toolchain # Support for out-of-tree toolchain

View file

@ -1,5 +1,9 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# Prevent CMake from testing the toolchain
set(CMAKE_C_COMPILER_FORCED 1)
set(CMAKE_CXX_COMPILER_FORCED 1)
# No official documentation exists for the "Generic" value, except their wiki. # No official documentation exists for the "Generic" value, except their wiki.
# #
# https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/CrossCompiling: # https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/CrossCompiling: