From 427c5ba8dfb849ea72d51e66e8f990e5e1a89572 Mon Sep 17 00:00:00 2001 From: Frantisek Hrbata Date: Thu, 10 Apr 2025 10:46:36 +0200 Subject: [PATCH] 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 --- components/xtensa/project_include.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/xtensa/project_include.cmake b/components/xtensa/project_include.cmake index f0c5bee8667..3ed44c2f59a 100644 --- a/components/xtensa/project_include.cmake +++ b/components/xtensa/project_include.cmake @@ -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