build & config: Don't include common components on early expansion

This commit is contained in:
Sergei Silnov
2023-02-27 10:06:31 +01:00
parent b8b3dfc366
commit 2540cee253
3 changed files with 10 additions and 4 deletions

View File

@@ -222,6 +222,15 @@ function(__build_expand_requirements component_target)
get_property(reqs TARGET ${component_target} PROPERTY REQUIRES)
get_property(priv_reqs TARGET ${component_target} PROPERTY PRIV_REQUIRES)
__component_get_property(component_name ${component_target} COMPONENT_NAME)
__component_get_property(component_alias ${component_target} COMPONENT_ALIAS)
idf_build_get_property(common_reqs __COMPONENT_REQUIRES_COMMON)
list(APPEND reqs ${common_reqs})
if(reqs)
list(REMOVE_DUPLICATES reqs)
list(REMOVE_ITEM reqs ${component_alias} ${component_name})
endif()
foreach(req ${reqs})
__build_resolve_and_add_req(_component_target ${component_target} ${req} __REQUIRES)

View File

@@ -408,8 +408,7 @@ macro(project project_name)
__component_get_target(main_target idf::main)
__component_get_property(reqs ${main_target} REQUIRES)
__component_get_property(priv_reqs ${main_target} PRIV_REQUIRES)
idf_build_get_property(common_reqs __COMPONENT_REQUIRES_COMMON)
if(reqs STREQUAL common_reqs AND NOT priv_reqs) #if user has not set any requirements
if(NOT reqs AND NOT priv_reqs) #if user has not set any requirements
if(test_components)
list(REMOVE_ITEM build_components ${test_components})
endif()

View File

@@ -123,8 +123,6 @@ foreach(__component_target ${__component_targets})
__component_get_requirements()
list(APPEND __component_requires "${__common_reqs}")
# Remove duplicates and the component itself from its requirements
__component_get_property(__component_alias ${__component_target} COMPONENT_ALIAS)
__component_get_property(__component_name ${__component_target} COMPONENT_NAME)