cmake: FindHostTools: Fix for hwmv2 for host based targets
With hwmv2, the ARCH variable is not yet defined when this module is loaded (kconfig is parsed after this). So we cannot rely on it to detect if we are building for a host target. For this case, let's instead detect it by the BOARD or BOARD_DIR which are some of the very few things defined at this point. We retain the old check to support hwmv1 boards which may be in other folders. Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
committed by
Carles Cufi
parent
c4b11e0251
commit
9a32559a2d
@@ -65,8 +65,9 @@ find_program(BOSSAC bossac)
|
||||
# in the mcuboot repository if that's present in some cases)
|
||||
find_program(IMGTOOL imgtool)
|
||||
|
||||
# Pick host system's toolchain if we are targeting posix
|
||||
if("${ARCH}" STREQUAL "posix" OR "${ARCH}" STREQUAL "unit_testing")
|
||||
# Default to the host system's toolchain if we are targeting a host based target
|
||||
if((${BOARD_DIR} MATCHES "boards\/native") OR ("${ARCH}" STREQUAL "posix")
|
||||
OR ("${BOARD}" STREQUAL "unit_testing"))
|
||||
if(NOT "${ZEPHYR_TOOLCHAIN_VARIANT}" STREQUAL "llvm")
|
||||
set(ZEPHYR_TOOLCHAIN_VARIANT "host")
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user