From bc34f01e20aaba7327cfd9b38abfa6517519e0a7 Mon Sep 17 00:00:00 2001 From: Paul-Louis Ageneau Date: Tue, 12 Nov 2024 18:46:22 +0100 Subject: [PATCH 1/3] CMake: Add installed deps to export set --- CMakeLists.txt | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 696f60407..d71bbd398 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -308,13 +308,7 @@ else() add_library(Usrsctp::Usrsctp ALIAS usrsctp) if(INSTALL_DEPS_LIBS) - # usrsctp lacks an export set - install(TARGETS usrsctp EXPORT UsrsctpTargets) - install(EXPORT UsrsctpTargets - FILE UsrsctpTargets.cmake - NAMESPACE Usrsctp:: - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/usrsctp - EXCLUDE_FROM_ALL) + install(TARGETS usrsctp EXPORT LibDataChannelTargets) # Fix directories set_target_properties(usrsctp PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "") target_include_directories(usrsctp INTERFACE @@ -381,7 +375,7 @@ else() if(NOT TARGET srtp2) add_subdirectory(deps/libsrtp EXCLUDE_FROM_ALL) if(INSTALL_DEPS_LIBS) - install(TARGETS srtp2) + install(TARGETS srtp2 EXPORT LibDataChannelTargets) endif() endif() target_compile_definitions(datachannel PRIVATE RTC_SYSTEM_SRTP=0) @@ -461,7 +455,7 @@ else() else() add_subdirectory(deps/libjuice EXCLUDE_FROM_ALL) if(INSTALL_DEPS_LIBS) - install(TARGETS juice) + install(TARGETS juice EXPORT LibDataChannelTargets) endif() target_compile_definitions(datachannel PRIVATE RTC_SYSTEM_JUICE=0) target_compile_definitions(datachannel-static PRIVATE RTC_SYSTEM_JUICE=0) From a1bd3071177ce400561e0807166e2eb3246fc77a Mon Sep 17 00:00:00 2001 From: Paul-Louis Ageneau Date: Fri, 22 Nov 2024 23:49:58 +0100 Subject: [PATCH 2/3] Fix lock order inversion in TcpTransport --- src/impl/tcptransport.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/impl/tcptransport.cpp b/src/impl/tcptransport.cpp index a83fda958..9f1a64a95 100644 --- a/src/impl/tcptransport.cpp +++ b/src/impl/tcptransport.cpp @@ -200,23 +200,23 @@ void TcpTransport::resolve() { } void TcpTransport::attempt() { - std::lock_guard lock(mSendMutex); + try { + std::lock_guard lock(mSendMutex); - if (state() != State::Connecting) - return; // Cancelled + if (state() != State::Connecting) + return; // Cancelled - if (mSock == INVALID_SOCKET) { - ::closesocket(mSock); - mSock = INVALID_SOCKET; - } + if (mSock == INVALID_SOCKET) { + ::closesocket(mSock); + mSock = INVALID_SOCKET; + } - if (mResolved.empty()) { - PLOG_WARNING << "Connection to " << mHostname << ":" << mService << " failed"; - changeState(State::Failed); - return; - } + if (mResolved.empty()) { + PLOG_WARNING << "Connection to " << mHostname << ":" << mService << " failed"; + changeState(State::Failed); + return; + } - try { auto [addr, addrlen] = mResolved.front(); mResolved.pop_front(); From 0d131af81a9a5fe648865cfda16c3d1612583a6e Mon Sep 17 00:00:00 2001 From: Paul-Louis Ageneau Date: Thu, 28 Nov 2024 10:38:05 +0100 Subject: [PATCH 3/3] Merge pull request #1297 from metalMajor/bugfix/findLibJuice libjuice: cmake find does not use correct names on imported target --- cmake/Modules/FindLibJuice.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/Modules/FindLibJuice.cmake b/cmake/Modules/FindLibJuice.cmake index 2a01c4846..a255b89b3 100644 --- a/cmake/Modules/FindLibJuice.cmake +++ b/cmake/Modules/FindLibJuice.cmake @@ -9,8 +9,8 @@ if (NOT TARGET LibJuice::LibJuice) add_library(LibJuice::LibJuice UNKNOWN IMPORTED) set_target_properties(LibJuice::LibJuice PROPERTIES IMPORTED_LOCATION "${JUICE_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES "${JUICE_INCLUDE_DIRS}" - INTERFACE_LINK_LIBRARIES "${JUICE_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${JUICE_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${JUICE_LIBRARY}" IMPORTED_LINK_INTERFACE_LANGUAGES "C") endif () endif ()