fix(websocket): clean up component dependencies

- Remove unused 'json', 'nvs_flash', 'esp_stubs', dependency from Linux build configuration
- Add cJSON dependency to target example's idf_component.yml
This commit is contained in:
surengab
2025-10-29 16:46:47 +04:00
parent c078c36361
commit d665e6f18e
4 changed files with 4 additions and 4 deletions

View File

@@ -11,7 +11,7 @@ endif()
if(${IDF_TARGET} STREQUAL "linux") if(${IDF_TARGET} STREQUAL "linux")
idf_component_register(SRCS "esp_websocket_client.c" idf_component_register(SRCS "esp_websocket_client.c"
INCLUDE_DIRS "include" INCLUDE_DIRS "include"
REQUIRES esp-tls tcp_transport http_parser esp_event nvs_flash esp_stubs json REQUIRES esp-tls tcp_transport http_parser esp_event
PRIV_REQUIRES esp_timer) PRIV_REQUIRES esp_timer)
else() else()
idf_component_register(SRCS "esp_websocket_client.c" idf_component_register(SRCS "esp_websocket_client.c"

View File

@@ -1,5 +1,5 @@
idf_component_register(SRCS "websocket_linux.c" idf_component_register(SRCS "websocket_linux.c"
REQUIRES esp_websocket_client protocol_examples_common) REQUIRES esp_websocket_client protocol_examples_common esp_netif)
if(CONFIG_GCOV_ENABLED) if(CONFIG_GCOV_ENABLED)
target_compile_options(${COMPONENT_LIB} PUBLIC --coverage -fprofile-arcs -ftest-coverage) target_compile_options(${COMPONENT_LIB} PUBLIC --coverage -fprofile-arcs -ftest-coverage)

View File

@@ -4,7 +4,6 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
#include <esp_log.h> #include <esp_log.h>
#include "nvs_flash.h"
#include "protocol_examples_common.h" #include "protocol_examples_common.h"
#include "esp_websocket_client.h" #include "esp_websocket_client.h"
@@ -160,7 +159,6 @@ int main(void)
esp_log_level_set("transport_ws", ESP_LOG_DEBUG); esp_log_level_set("transport_ws", ESP_LOG_DEBUG);
esp_log_level_set("trans_tcp", ESP_LOG_DEBUG); esp_log_level_set("trans_tcp", ESP_LOG_DEBUG);
ESP_ERROR_CHECK(nvs_flash_init());
ESP_ERROR_CHECK(esp_netif_init()); ESP_ERROR_CHECK(esp_netif_init());
ESP_ERROR_CHECK(esp_event_loop_create_default()); ESP_ERROR_CHECK(esp_event_loop_create_default());

View File

@@ -4,5 +4,7 @@ dependencies:
espressif/esp_websocket_client: espressif/esp_websocket_client:
version: "^1.0.0" version: "^1.0.0"
override_path: "../../../" override_path: "../../../"
espressif/cjson:
version: "^1.7.15"
protocol_examples_common: protocol_examples_common:
path: ${IDF_PATH}/examples/common_components/protocol_examples_common path: ${IDF_PATH}/examples/common_components/protocol_examples_common