fix(xtensa/cmake): do not include project_include.cmake if the architecture is not xtensa

In cmakev2, the project_include.cmake files for every component are
included. This means that even when working with RISC-V, the
project_include.cmake file for Xtensa is still included. Ensure that the
architecture is verified, and exit if it is not Xtensa.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
This commit is contained in:
Frantisek Hrbata
2025-04-10 10:46:36 +02:00
committed by BOT
parent 69a67e7e6e
commit 427c5ba8df
+5
View File
@@ -1,3 +1,8 @@
idf_build_get_property(idf_target_arch IDF_TARGET_ARCH)
if(NOT "${idf_target_arch}" STREQUAL "xtensa")
return()
endif()
# Check toolchain is configured properly in cmake
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
# without '--target' option 'clang -dumpmachine' prints default target arch and it might be not Xtensa