2019-04-06 21:08:09 +08:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2018-12-13 23:32:07 +08:00
|
|
|
set_ifndef(CC gcc)
|
|
|
|
|
2020-05-19 16:09:28 +08:00
|
|
|
find_program(CMAKE_C_COMPILER ${CROSS_COMPILE}${CC} PATHS ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
|
2021-08-28 06:57:15 +08:00
|
|
|
find_program(CMAKE_GCOV ${CROSS_COMPILE}gcov PATHS ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
|
2018-12-13 23:32:07 +08:00
|
|
|
|
|
|
|
if(CMAKE_C_COMPILER STREQUAL CMAKE_C_COMPILER-NOTFOUND)
|
|
|
|
message(FATAL_ERROR "Zephyr was unable to find the toolchain. Is the environment misconfigured?
|
|
|
|
User-configuration:
|
|
|
|
ZEPHYR_TOOLCHAIN_VARIANT: ${ZEPHYR_TOOLCHAIN_VARIANT}
|
|
|
|
Internal variables:
|
|
|
|
CROSS_COMPILE: ${CROSS_COMPILE}
|
|
|
|
TOOLCHAIN_HOME: ${TOOLCHAIN_HOME}
|
|
|
|
")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
execute_process(
|
|
|
|
COMMAND ${CMAKE_C_COMPILER} --version
|
|
|
|
RESULT_VARIABLE ret
|
|
|
|
OUTPUT_QUIET
|
|
|
|
ERROR_QUIET
|
|
|
|
)
|
|
|
|
if(ret)
|
|
|
|
message(FATAL_ERROR "Executing the below command failed. Are permissions set correctly?
|
|
|
|
'${CMAKE_C_COMPILER} --version'
|
|
|
|
"
|
|
|
|
)
|
|
|
|
endif()
|