mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-08-13 07:25:22 +00:00
Split up the toolchain configuration into two phases, generic and target. The 'generic' phase configures the toolchain just enough to be able to preprocess DT files. The 'target' phase completes the configuration with target-specific configuration. Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
27 lines
699 B
CMake
27 lines
699 B
CMake
set_ifndef(CC gcc)
|
|
|
|
find_program(CMAKE_C_COMPILER ${CROSS_COMPILE}${CC} PATH ${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?
|
|
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()
|