diff --git a/components/esp_libc/CMakeLists.txt b/components/esp_libc/CMakeLists.txt index 3c354f2932..9aaebf5825 100644 --- a/components/esp_libc/CMakeLists.txt +++ b/components/esp_libc/CMakeLists.txt @@ -77,10 +77,18 @@ else() list(APPEND ldfragments src/picolibc/libc.lf) endif() +set(priv_reqs soc spi_flash) + +if(IDF_BUILD_V2) + if(CONFIG_VFS_SUPPORT_IO) + list(APPEND priv_reqs vfs) + endif() +endif() + idf_component_register(SRCS "${srcs}" INCLUDE_DIRS platform_include PRIV_INCLUDE_DIRS priv_include - PRIV_REQUIRES soc spi_flash + PRIV_REQUIRES "${priv_reqs}" LDFRAGMENTS "${ldfragments}") # Toolchain libraries require code defined in this component