From d9eb78c1fd08c43f349b7daafa3d244d1452347d Mon Sep 17 00:00:00 2001 From: Frantisek Hrbata Date: Wed, 20 Aug 2025 16:24:28 +0200 Subject: [PATCH] feat(cmakev2/compat): link common components in idf_component_register Automatically link commonly required components to the component target created in the idf_component_register function. This is still necessary even in cmakev2, as existing components depend on this behavior. Signed-off-by: Frantisek Hrbata --- tools/cmakev2/compat.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/cmakev2/compat.cmake b/tools/cmakev2/compat.cmake index 6e93a3c12a..62edfdfb2f 100644 --- a/tools/cmakev2/compat.cmake +++ b/tools/cmakev2/compat.cmake @@ -253,6 +253,11 @@ function(idf_component_register) __get_compile_options(OUTPUT compile_options) add_compile_options("${compile_options}") + idf_build_get_property(common_component_interfaces __COMMON_COMPONENT_INTERFACES) + idf_component_get_property(component_interface "${COMPONENT_NAME}" COMPONENT_INTERFACE) + list(REMOVE_ITEM common_component_interfaces ${component_interface}) + link_libraries(${common_component_interfaces}) + __get_absolute_paths(PATHS "${ARG_INCLUDE_DIRS}" BASE_DIR "${COMPONENT_DIR}" OUTPUT include_dirs) __get_absolute_paths(PATHS "${ARG_PRIV_INCLUDE_DIRS}" BASE_DIR "${COMPONENT_DIR}" OUTPUT priv_include_dirs) foreach(dir IN LISTS include_dirs priv_include_dirs)