mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 11:03:11 +00:00
fix(cmakev2): propagate IDF_TOOLCHAIN selection to sdkconfig generation
In the cmakev2 build framework, the selected toolchain was not consistently propagated to sdkconfig generation. For clang builds, this produced a configuration that was incompatible with the clang toolchain and broke compilation. Ensure the toolchain selection is observed consistently so sdkconfig and component configuration reflect the intended toolchain for both GCC and clang builds. Made-with: Cursor
This commit is contained in:
@@ -317,6 +317,13 @@ function(__init_toolchain)
|
||||
idf_die("Toolchain file ${toolchain_file} not found")
|
||||
endif()
|
||||
|
||||
# IDF_TOOLCHAIN applies to Espressif targets only; on linux (host build)
|
||||
# it must stay empty so Kconfig leaves both CONFIG_IDF_TOOLCHAIN_GCC and
|
||||
# CONFIG_IDF_TOOLCHAIN_CLANG unset.
|
||||
if(NOT "${idf_target}" STREQUAL "linux")
|
||||
set(IDF_TOOLCHAIN "${toolchain}" CACHE STRING "IDF Build Toolchain Type" FORCE)
|
||||
endif()
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE "${toolchain_file}" PARENT_SCOPE)
|
||||
idf_build_set_property(IDF_TOOLCHAIN_FILE "${toolchain_file}")
|
||||
endfunction()
|
||||
|
||||
Reference in New Issue
Block a user