From ace564b826eeeb4a6933f94b471c8a0f4e8786d0 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Wed, 18 Dec 2024 11:32:22 +0100 Subject: [PATCH] fix(asio): Fails to resove dependency? --- components/asio/CMakeLists.txt | 1 + .../ssl_client_server/main/idf_component.yml | 2 +- components/asio/idf_component.yml | 1 + components/asio/port/src/asio_stub.cpp | 19 +++++++++++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/components/asio/CMakeLists.txt b/components/asio/CMakeLists.txt index bc62652c8a..4e7ab07d3a 100644 --- a/components/asio/CMakeLists.txt +++ b/components/asio/CMakeLists.txt @@ -30,6 +30,7 @@ target_compile_definitions(${COMPONENT_LIB} PUBLIC SA_RESTART=0x01 ASIO_STANDALONE ASIO_HAS_PTHREADS OPENSSL_NO_ENGINE + ASIO_DETAIL_IMPL_POSIX_EVENT_IPP # to inject our own posix_event ) if(NOT CONFIG_COMPILER_CXX_EXCEPTIONS) diff --git a/components/asio/examples/ssl_client_server/main/idf_component.yml b/components/asio/examples/ssl_client_server/main/idf_component.yml index 0872893d32..cc51088874 100644 --- a/components/asio/examples/ssl_client_server/main/idf_component.yml +++ b/components/asio/examples/ssl_client_server/main/idf_component.yml @@ -6,4 +6,4 @@ dependencies: override_path: "../../../" protocol_examples_common: path: ${IDF_PATH}/examples/common_components/protocol_examples_common - espressif/sock_utils: "*" +# espressif/sock_utils: "*" diff --git a/components/asio/idf_component.yml b/components/asio/idf_component.yml index a54601f0f9..5edd07db41 100644 --- a/components/asio/idf_component.yml +++ b/components/asio/idf_component.yml @@ -7,3 +7,4 @@ repository: https://github.com/espressif/esp-protocols.git dependencies: idf: version: ">=5.0" + espressif/sock_utils: "*" diff --git a/components/asio/port/src/asio_stub.cpp b/components/asio/port/src/asio_stub.cpp index a65cfac12d..341abd6db6 100644 --- a/components/asio/port/src/asio_stub.cpp +++ b/components/asio/port/src/asio_stub.cpp @@ -3,9 +3,28 @@ // // SPDX-License-Identifier: Apache-2.0 // +#include "asio/detail/posix_event.hpp" +#include "asio/detail/throw_error.hpp" +#include "asio/error.hpp" +#include "asio/detail/push_options.hpp" #include #include +namespace asio { +namespace detail { + +posix_event::posix_event() + : state_(0) +{ + int error = ::pthread_cond_init(&cond_, 0); + asio::error_code ec(error, + asio::error::get_system_category()); + asio::detail::throw_error(ec, "event"); +} + +} // namespace detail +} // namespace asio + extern "C" int pause (void) { while (true) {