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 <frantisek.hrbata@espressif.com>
This commit is contained in:
Frantisek Hrbata
2026-03-20 08:16:52 +01:00
parent 53b684c00d
commit e14d50b79b
+1 -1
View File
@@ -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${sdkconfig_dir})
list(APPEND ULP_PREPRO_ARGS -I${IDF_PATH}/components/esp_system/ld) 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 # Pre-process the linker script
if(CONFIG_ULP_COPROC_TYPE_RISCV) if(CONFIG_ULP_COPROC_TYPE_RISCV)