Files
Frantisek Hrbata 22cf5a61ef fix(esp_usb_cdc_rom_console/cmake): avoid using uninitialized srcs variable
In cmakev2, the component CMakeLists.txt files are evaluated recursively
based on the component dependencies. This means that variables from
previously evaluated components are set and available in the scope of
the currently evaluated component. It is necessary to initialize every
variable that is used.

Fixes: 56e0c11bb6 ("feat(usb_cdc_console): moved usb-cdc ROM console to n..")
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00

20 lines
609 B
CMake

idf_build_get_property(target IDF_TARGET)
set(srcs)
if(CONFIG_ESP_CONSOLE_USB_CDC)
list(APPEND srcs "usb_console.c")
endif()
idf_component_register(SRCS ${srcs}
INCLUDE_DIRS include
PRIV_REQUIRES esp_timer
LDFRAGMENTS linker.lf
)
if(CONFIG_VFS_SUPPORT_IO AND CONFIG_ESP_CONSOLE_USB_CDC)
target_link_libraries(${COMPONENT_LIB} PUBLIC idf::vfs)
target_sources(${COMPONENT_LIB} PRIVATE "vfs_cdcacm.c")
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u esp_vfs_dev_cdcacm_include_dev_init")
endif()