From f17f80bfdd0cf3a9042b46aaf8d35b7e22da9737 Mon Sep 17 00:00:00 2001 From: Frantisek Hrbata Date: Tue, 10 Mar 2026 13:49:55 +0100 Subject: [PATCH 1/3] fix(cmakev2/kconfig): add public aliases for sdkconfig output properties The cmakev2 kconfig module sets sdkconfig output paths using internal property names (__SDKCONFIG_HEADER, __SDKCONFIG_CMAKE, etc.), but components like ULP read the public names (SDKCONFIG_HEADER, SDKCONFIG_CMAKE). This results in empty values being passed to the ULP sub-project, causing its CMake configure step to fail. Add public aliases matching the cmake v1 property names for backward compatibility. Signed-off-by: Frantisek Hrbata --- tools/cmakev2/kconfig.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/cmakev2/kconfig.cmake b/tools/cmakev2/kconfig.cmake index a4b08c5a53..de38a6ab7b 100644 --- a/tools/cmakev2/kconfig.cmake +++ b/tools/cmakev2/kconfig.cmake @@ -656,12 +656,18 @@ function(__generate_kconfig_outputs) set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" APPEND PROPERTY ADDITIONAL_CLEAN_FILES "${sdkconfig_header}" "${sdkconfig_cmake}") - # Store output paths in build properties + # Store output paths in build properties (internal) idf_build_set_property(__SDKCONFIG_HEADER "${sdkconfig_header}") idf_build_set_property(__SDKCONFIG_CMAKE "${sdkconfig_cmake}") idf_build_set_property(__SDKCONFIG_JSON "${sdkconfig_json}") idf_build_set_property(__SDKCONFIG_JSON_MENUS "${sdkconfig_json_menus}") + # Public aliases for backward compatibility with components (e.g. ULP) + idf_build_set_property(SDKCONFIG_HEADER "${sdkconfig_header}") + idf_build_set_property(SDKCONFIG_CMAKE "${sdkconfig_cmake}") + idf_build_set_property(SDKCONFIG_JSON "${sdkconfig_json}") + idf_build_set_property(SDKCONFIG_JSON_MENUS "${sdkconfig_json_menus}") + idf_msg("Generated Kconfig outputs in ${config_dir}") endfunction() From aad1f9845b2fa265db270783193c67b26e0c89ce Mon Sep 17 00:00:00 2001 From: Frantisek Hrbata Date: Tue, 10 Mar 2026 14:04:14 +0100 Subject: [PATCH 2/3] fix(cmakev2/project): export build properties as variables for project_include.cmake In cmake v1, __build_process_project_includes() exports all build properties as CMake variables before including project_include.cmake files. cmakev2 was missing this step, causing components like ULP that reference build properties as CMake variables (e.g. ${SDKCONFIG_HEADER}) to receive empty values. Signed-off-by: Frantisek Hrbata --- tools/cmakev2/project.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/cmakev2/project.cmake b/tools/cmakev2/project.cmake index c4da93808a..b26a9a49a1 100644 --- a/tools/cmakev2/project.cmake +++ b/tools/cmakev2/project.cmake @@ -604,6 +604,15 @@ macro(idf_project_init) # Ensure this is done after including the sdkconfig. __init_idf_target_arch() + # Make build properties available as CMake variables for backward + # compatibility with project_include.cmake files (e.g. ULP component + # references ${SDKCONFIG_HEADER} and ${SDKCONFIG_CMAKE} directly). + idf_build_get_property(build_properties BUILD_PROPERTIES) + foreach(build_property IN LISTS build_properties) + idf_build_get_property(val ${build_property}) + set(${build_property} "${val}") + endforeach() + # Include all project_include.cmake files for the components that have # been discovered. idf_build_get_property(component_interfaces COMPONENT_INTERFACES) From f46b26fa47b7bf953789d8df0d7cdbb9ab9ac53e Mon Sep 17 00:00:00 2001 From: Frantisek Hrbata Date: Tue, 10 Mar 2026 16:13:11 +0100 Subject: [PATCH 3/3] fix(ulp): add sdkconfig directory to ULP target include directories The ULP sources include sdkconfig.h for compile-time configuration values. The sdkconfig directory was previously available to the ULP target indirectly through the COMPONENT_INCLUDES variable, which is populated from the parent component's INTERFACE_INCLUDE_DIRECTORIES. In cmake v1, idf_component_register() adds the config_dir as PUBLIC include directory to every component (component.cmake:498), so it ends up in INTERFACE_INCLUDE_DIRECTORIES and gets passed to the ULP subproject via COMPONENT_INCLUDES. In cmakev2, the config_dir is added as a build-level property and applied to components as PRIVATE (component.cmake:1053), so it no longer appears in INTERFACE_INCLUDE_DIRECTORIES. As a result, the sdkconfig directory is missing from the ULP target's include paths. Add the sdkconfig directory explicitly to the ULP target's include directories. Note that SDKCONFIG_HEADER is already passed to the ULP subproject and its directory is already extracted into sdkconfig_dir for linker script preprocessing (IDFULPProject.cmake:40). Signed-off-by: Frantisek Hrbata --- components/ulp/cmake/IDFULPProject.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/ulp/cmake/IDFULPProject.cmake b/components/ulp/cmake/IDFULPProject.cmake index fbab4d6992..ec5d85e9db 100644 --- a/components/ulp/cmake/IDFULPProject.cmake +++ b/components/ulp/cmake/IDFULPProject.cmake @@ -49,7 +49,7 @@ function(ulp_apply_default_sources ulp_app_name) list(APPEND ULP_PREPRO_ARGS -I${sdkconfig_dir}) list(APPEND ULP_PREPRO_ARGS -I${IDF_PATH}/components/esp_system/ld) - target_include_directories(${ulp_app_name} PRIVATE ${COMPONENT_INCLUDES}) + target_include_directories(${ulp_app_name} PRIVATE ${COMPONENT_INCLUDES} ${sdkconfig_dir}) # Pre-process the linker script if(CONFIG_ULP_COPROC_TYPE_RISCV)