From 94ecca207341b3c5b47f717ce0ed3d48b0f7d086 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Wed, 11 May 2022 16:01:48 +0200 Subject: [PATCH] esp_netif/lwip: Fix deps cycles to "lwip -> esp_netif -> phy-drivers" Fix dependency tree so that lwip doesn't depend on any specific network interface component. Network interface drivers shall depend on esp_netif. esp_netif shall depend on lwip (but not on any specific interface driver) -- it optionally depends on vfs and esp_eth (need ethernet header for L2/bridge mode) --- components/mqtt/CMakeLists.txt | 7 ++----- components/mqtt/test/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/components/mqtt/CMakeLists.txt b/components/mqtt/CMakeLists.txt index 2e57327..629aca8 100644 --- a/components/mqtt/CMakeLists.txt +++ b/components/mqtt/CMakeLists.txt @@ -119,9 +119,6 @@ idf_component_get_property(mbedtls_dir mbedtls COMPONENT_DIR) target_link_libraries(${COMPONENT_LIB} PUBLIC mocks) else() - idf_component_get_property(http_parser_lib http_parser COMPONENT_LIB) - idf_component_get_property(tcp_transport_lib tcp_transport COMPONENT_LIB) - idf_component_get_property(lwip_lib lwip COMPONENT_LIB) - target_link_libraries(${COMPONENT_LIB} PUBLIC ${http_parser_lib} ${tcp_transport_lib}) - target_link_libraries(${COMPONENT_LIB} PRIVATE ${lwip_lib}) + idf_component_optional_requires(PUBLIC esp_event tcp_transport) + idf_component_optional_requires(PRIVATE http_parser) endif() diff --git a/components/mqtt/test/CMakeLists.txt b/components/mqtt/test/CMakeLists.txt index a5b7606..4910339 100644 --- a/components/mqtt/test/CMakeLists.txt +++ b/components/mqtt/test/CMakeLists.txt @@ -1,2 +1,2 @@ idf_component_register(SRC_DIRS "." - PRIV_REQUIRES cmock test_utils mqtt nvs_flash app_update esp_eth) + PRIV_REQUIRES cmock test_utils mqtt nvs_flash app_update esp_eth esp_netif)