diff --git a/tools/cmakev2/component.cmake b/tools/cmakev2/component.cmake index b38680cc993..08a9ca5c67c 100644 --- a/tools/cmakev2/component.cmake +++ b/tools/cmakev2/component.cmake @@ -885,12 +885,12 @@ function(idf_component_include name) # helps in detecting and reporting circular dependencies, such as # C1->C2->C1. In this scenario, C2 can still use the C1 interface target, # but C1 will only be fully evaluated after C2 has been evaluated. - if("${component_name}" IN_LIST __DEPENDENCY_CHAIN) - idf_dbg("Component '${name}' in circular dependency chain '${__DEPENDENCY_CHAIN}'") + if("${component_interface}" IN_LIST __DEPENDENCY_CHAIN) + idf_dbg("Component '${component_interface}' in circular dependency chain '${__DEPENDENCY_CHAIN}'") return() endif() - list(APPEND __DEPENDENCY_CHAIN "${name}") + list(APPEND __DEPENDENCY_CHAIN "${component_interface}") # Evaluate the CMakeLists.txt file of the component. idf_component_get_property(component_build_dir "${component_name}" COMPONENT_BUILD_DIR) add_subdirectory("${component_directory}" "${component_build_dir}")