Some of these libraries require additional managed components that are only used if the library is included in the project.
My CMake file generates a list of sources and a list of requirements to be included, which are then used in `idf_component_register`.
For example
Code: Select all
set(src "lib_config/lib_config.c")
list(APPEND src "lib_sockets/lib_sockets.c"
"lib_sockets/lib_phy_socket.c" )
if (CONFIG_ENABLE_LITTLEFS_LIB)
list(APPEND src "lib_littlefs/lib_littlefs.c" )
endif()
....
.....
Code: Select all
set(requires json vfs sdmmc fatfs spiffs nvs_flash)
list (APPEND requires esp_wifi wpa_supplicant lwip wifi_provisioning)
list (APPEND requires esp_event esp_psram)
.....
.....
Code: Select all
idf_component_register(SRCS ${src}
INCLUDE_DIRS ${includes}
REQUIRES ${requires}
....
....
Code: Select all
if(CONFIG_ENABLE_IPFILTER_LIB)
list(APPEND src "lib_ipfilter/lib_ipfilter.c" )
list (APPEND requires espressif__esp_dns)
endif()
I must move the list (APPEND requires espressif__esp_dns) outside of the "if" statement in order to successfully compile the project
I don’t understand why this happens. In both cases, the list of requirements printed with
Code: Select all
message ("${requires}") thanks