cmake: make build components available before immediately
Previous implementation only builds list of components included in the build during component registration. Since the build components is known as the requirements expansion is ongoing, update the list here instead.
This commit is contained in:
parent
aa087667df
commit
88320062b8
2 changed files with 4 additions and 4 deletions
|
@ -220,6 +220,10 @@ function(__build_expand_requirements component_target)
|
||||||
idf_build_get_property(build_component_targets __BUILD_COMPONENT_TARGETS)
|
idf_build_get_property(build_component_targets __BUILD_COMPONENT_TARGETS)
|
||||||
if(NOT component_target IN_LIST build_component_targets)
|
if(NOT component_target IN_LIST build_component_targets)
|
||||||
idf_build_set_property(__BUILD_COMPONENT_TARGETS ${component_target} APPEND)
|
idf_build_set_property(__BUILD_COMPONENT_TARGETS ${component_target} APPEND)
|
||||||
|
__component_get_property(component_lib ${component_target} COMPONENT_LIB)
|
||||||
|
idf_build_set_property(__BUILD_COMPONENTS ${component_lib} APPEND)
|
||||||
|
__component_get_property(component_alias ${component_target} COMPONENT_ALIAS)
|
||||||
|
idf_build_set_property(BUILD_COMPONENTS ${component_alias} APPEND)
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
|
|
@ -481,10 +481,6 @@ function(idf_component_register)
|
||||||
# Set dependencies
|
# Set dependencies
|
||||||
__component_set_all_dependencies()
|
__component_set_all_dependencies()
|
||||||
|
|
||||||
# Add the component to built components
|
|
||||||
idf_build_set_property(__BUILD_COMPONENTS ${component_lib} APPEND)
|
|
||||||
idf_build_set_property(BUILD_COMPONENTS ${component_alias} APPEND)
|
|
||||||
|
|
||||||
# Make the COMPONENT_LIB variable available in the component CMakeLists.txt
|
# Make the COMPONENT_LIB variable available in the component CMakeLists.txt
|
||||||
set(COMPONENT_LIB ${component_lib} PARENT_SCOPE)
|
set(COMPONENT_LIB ${component_lib} PARENT_SCOPE)
|
||||||
# COMPONENT_TARGET is deprecated but is made available with same function
|
# COMPONENT_TARGET is deprecated but is made available with same function
|
||||||
|
|
Loading…
Reference in a new issue