| # SPDX-License-Identifier: Apache-2.0 |
| find_program(CMAKE_C_COMPILER ${CROSS_COMPILE}${CC} PATHS ${TOOLCHAIN_HOME} NO_DEFAULT_PATH) |
| find_program(CMAKE_GCOV ${CROSS_COMPILE}gcov PATHS ${TOOLCHAIN_HOME} NO_DEFAULT_PATH) |
| if(CMAKE_C_COMPILER STREQUAL CMAKE_C_COMPILER-NOTFOUND) |
| message(FATAL_ERROR "Zephyr was unable to find the toolchain. Is the environment misconfigured? |
| ZEPHYR_TOOLCHAIN_VARIANT: ${ZEPHYR_TOOLCHAIN_VARIANT} |
| CROSS_COMPILE: ${CROSS_COMPILE} |
| TOOLCHAIN_HOME: ${TOOLCHAIN_HOME} |
| COMMAND ${CMAKE_C_COMPILER} --version |
| OUTPUT_VARIABLE stdoutput |
| message(FATAL_ERROR "Executing the below command failed. Are permissions set correctly? |
| ${CMAKE_C_COMPILER} --version |