diff --git a/CMakeLists.txt b/CMakeLists.txt index b34bdf021a6..f95c97ba3de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,11 +36,6 @@ endif() # -fmacro-prefix-map=${ZEPHYR_BASE}= -# Verify that the toolchain can compile a dummy file, if it is not we -# won't be able to test for compatibility with certain C flags. -zephyr_check_compiler_flag(C "" toolchain_is_ok) -assert(toolchain_is_ok "The toolchain is unable to build a dummy C file. See CMakeError.log.") - # In some cases the "final" things are not used at all and "_prebuilt" # is the last station. See "logical_target_for_zephyr_elf" below for # details. diff --git a/cmake/app/boilerplate.cmake b/cmake/app/boilerplate.cmake index 1fb8499de7c..6102d739c9f 100644 --- a/cmake/app/boilerplate.cmake +++ b/cmake/app/boilerplate.cmake @@ -595,11 +595,18 @@ project(Zephyr-Kernel VERSION ${PROJECT_VERSION}) # windows now. list(APPEND CMAKE_ASM_SOURCE_FILE_EXTENSIONS "S") enable_language(C CXX ASM) + # The setup / configuration of the toolchain itself and the configuration of # supported compilation flags are now split, as this allows to use the toolchain # for generic purposes, for example DTS, and then test the toolchain for # supported flags at stage two. # Testing the toolchain flags requires the enable_language() to have been called in CMake. + +# Verify that the toolchain can compile a dummy file, if it is not we +# won't be able to test for compatibility with certain C flags. +zephyr_check_compiler_flag(C "" toolchain_is_ok) +assert(toolchain_is_ok "The toolchain is unable to build a dummy C file. See CMakeError.log.") + include(${ZEPHYR_BASE}/cmake/target_toolchain_flags.cmake) # 'project' sets PROJECT_BINARY_DIR to ${CMAKE_CURRENT_BINARY_DIR},