From e14d50b79b550c49a140f02448256ecbf9d2de56 Mon Sep 17 00:00:00 2001 From: Frantisek Hrbata Date: Tue, 10 Mar 2026 16:13:11 +0100 Subject: [PATCH] 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 fbab4d69928..ec5d85e9db1 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)