feat(cmakev2/project): allow to include all discovered components

If the IDF_INCLUDE_ALL_COMPONENTS variable is set, all discovered
components will be included. By default, components are included based
on their requirements. When IDF_INCLUDE_ALL_COMPONENTS is enabled, the
all_component_info dictionary in the project_description.json file will
be fully populated.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
This commit is contained in:
Frantisek Hrbata
2025-08-29 14:56:22 +02:00
parent aad467b5d1
commit 2ac4afeb53

View File

@@ -560,6 +560,19 @@ macro(idf_project_init)
endif()
endforeach()
# If explicitly requested, include all components by calling
# `add_subdirectory` for every discovered component. The default
# behavior is to include only the components based on the requirements.
__get_default_value(VARIABLE IDF_INCLUDE_ALL_COMPONENTS
DEFAULT NO
OUTPUT include_all_components)
if(include_all_components)
idf_msg("Including all discovered components")
foreach(component_name IN LISTS component_names)
idf_component_include("${component_name}")
endforeach()
endif()
idf_build_set_property(__PROJECT_INITIALIZED YES)
endif()
unset(project_initialized)