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)