feat: support kconfig in component manager

This commit is contained in:
Fu Hanxi
2025-09-01 09:43:09 +02:00
parent 70a6909bef
commit d595ea9b2b
4 changed files with 175 additions and 22 deletions
+26 -9
View File
@@ -61,7 +61,7 @@ if(NOT "$ENV{IDF_COMPONENT_MANAGER}" EQUAL "0")
idf_build_set_property(IDF_COMPONENT_MANAGER 1)
endif()
# Set component manager interface version
idf_build_set_property(__COMPONENT_MANAGER_INTERFACE_VERSION 3)
idf_build_set_property(__COMPONENT_MANAGER_INTERFACE_VERSION 4)
#
# Parse and store the VERSION argument provided to the project() command.
@@ -715,14 +715,31 @@ macro(project project_name)
message(STATUS "Building ESP-IDF components for target ${IDF_TARGET}")
idf_build_process(${IDF_TARGET}
SDKCONFIG_DEFAULTS "${sdkconfig_defaults}"
SDKCONFIG ${sdkconfig}
BUILD_DIR ${build_dir}
PROJECT_NAME ${CMAKE_PROJECT_NAME}
PROJECT_DIR ${CMAKE_CURRENT_LIST_DIR}
PROJECT_VER "${project_ver}"
COMPONENTS "${components};${test_components}")
set(result 0)
set(retried 0)
while(true)
idf_build_process(${IDF_TARGET}
SDKCONFIG_DEFAULTS "${sdkconfig_defaults}"
SDKCONFIG ${sdkconfig}
BUILD_DIR ${build_dir}
PROJECT_NAME ${CMAKE_PROJECT_NAME}
PROJECT_DIR ${CMAKE_CURRENT_LIST_DIR}
PROJECT_VER "${project_ver}"
COMPONENTS "${components};${test_components}"
)
if(result EQUAL 0)
break()
elseif(result EQUAL 10 AND retried EQUAL 0)
message(WARNING "Missing kconfig option. Re-run the build process...")
set(retried 1)
elseif(result EQUAL 10 AND retried EQUAL 1)
message(FATAL_ERROR "Missing required kconfig option after retry.")
else()
message(FATAL_ERROR "idf_build_process failed with exit code ${result}")
endif()
endwhile()
# Special treatment for 'main' component for standard projects (not part of core build system).
# Have it depend on every other component in the build. This is