mirror of
https://github.com/mii443/libdatachannel.git
synced 2025-08-23 15:48:03 +00:00
Compare commits
15 Commits
Author | SHA1 | Date | |
---|---|---|---|
1724c572a5 | |||
503a5d8a51 | |||
610cd85f9d | |||
6a5a5b7db2 | |||
4d7bf99144 | |||
190dc954fd | |||
46efdbe904 | |||
a1fb21eeb6 | |||
cffe3df7ed | |||
8aebe2a8a4 | |||
86f7bd6dba | |||
cc4346a6e8 | |||
0625508348 | |||
cc01baee7f | |||
6f7e59b973 |
1
.github/FUNDING.yml
vendored
Normal file
1
.github/FUNDING.yml
vendored
Normal file
@ -0,0 +1 @@
|
||||
custom: ['https://paypal.me/paullouisageneau']
|
@ -1,7 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.7)
|
||||
project(libdatachannel
|
||||
DESCRIPTION "WebRTC Data Channels Library"
|
||||
VERSION 0.6.5
|
||||
VERSION 0.6.6
|
||||
LANGUAGES CXX)
|
||||
|
||||
option(USE_GNUTLS "Use GnuTLS instead of OpenSSL" OFF)
|
||||
@ -90,6 +90,7 @@ find_package(Threads REQUIRED)
|
||||
set(CMAKE_POLICY_DEFAULT_CMP0048 NEW)
|
||||
add_subdirectory(deps/plog)
|
||||
|
||||
set(sctp_build_programs 0)
|
||||
add_subdirectory(deps/usrsctp EXCLUDE_FROM_ALL)
|
||||
if (MSYS OR MINGW)
|
||||
target_compile_definitions(usrsctp PUBLIC -DSCTP_STDINT_INCLUDE=<stdint.h>)
|
||||
|
76
Jamfile
76
Jamfile
@ -69,8 +69,9 @@ alias juice
|
||||
: # no default build
|
||||
: # usage requirements
|
||||
<include>./deps/libjuice/include
|
||||
<library>libjuice-static.a
|
||||
<gnutls>on:<library>nettle
|
||||
<gnutls>on:<library>libjuice-gnutls.a
|
||||
<gnutls>on:<library>nettle/<link>shared
|
||||
<gnutls>off:<library>libjuice-openssl.a
|
||||
;
|
||||
|
||||
alias juice
|
||||
@ -89,69 +90,66 @@ rule make_libusrsctp ( targets * : sources * : properties * )
|
||||
{
|
||||
local VARIANT = [ feature.get-values <variant> : $(properties) ] ;
|
||||
VARIANT on $(targets) = $(VARIANT) ;
|
||||
if <gnutls>on in $(properties)
|
||||
{ BUILD_DIR on $(targets) = "build-gnutls-$(VARIANT)" ; }
|
||||
else
|
||||
{ BUILD_DIR on $(targets) = "build-openssl-$(VARIANT)" ; }
|
||||
BUILD_DIR on $(targets) = "build-$(VARIANT)" ;
|
||||
}
|
||||
actions make_libusrsctp
|
||||
{
|
||||
(cd $(CWD)/deps/usrsctp && mkdir $(BUILD_DIR) && cd $(BUILD_DIR) && cmake -DCMAKE_BUILD_TYPE=$(VARIANT) -DCMAKE_C_FLAGS="-fPIC" .. && make -j2 usrsctp-static)
|
||||
(cd $(CWD)/deps/usrsctp && mkdir -p $(BUILD_DIR) && cd $(BUILD_DIR) && cmake -DCMAKE_BUILD_TYPE=$(VARIANT) -DCMAKE_C_FLAGS="-fPIC -Wno-unknown-warning-option -Wno-format-truncation" .. && make -j2 usrsctp-static)
|
||||
cp $(CWD)/deps/usrsctp/$(BUILD_DIR)/usrsctplib/libusrsctp.a $(<)
|
||||
}
|
||||
rule make_libusrsctp_msvc ( targets * : sources * : properties * )
|
||||
{
|
||||
local VARIANT = [ feature.get-values <variant> : $(properties) ] ;
|
||||
VARIANT on $(targets) = $(VARIANT) ;
|
||||
if <gnutls>on in $(properties)
|
||||
{ BUILD_DIR on $(targets) = "build-gnutls-$(VARIANT)" ; }
|
||||
else
|
||||
{ BUILD_DIR on $(targets) = "build-openssl-$(VARIANT)" ; }
|
||||
BUILD_DIR on $(targets) = "build-$(VARIANT)" ;
|
||||
}
|
||||
actions make_libusrsctp_msvc
|
||||
{
|
||||
SET OLDD=%CD%
|
||||
cd $(CWD)/deps/usrsctp
|
||||
mkdir $(BUILD_SIR)
|
||||
mkdir $(BUILD_DIR)
|
||||
cd $(BUILD_DIR)
|
||||
cmake -G "Visual Studio 16 2019" ..
|
||||
msbuild usrsctplib.sln /property:Configuration=$(VARIANT)
|
||||
cd %OLDD%
|
||||
cp $(CWD)/deps/usrsctp/build/usrsctplib/Release/usrsctp.lib $(<)
|
||||
cp $(CWD)/deps/usrsctp/$(BUILD_DIR)/usrsctplib/Release/usrsctp.lib $(<)
|
||||
}
|
||||
|
||||
make libjuice-static.a : : @make_libjuice ;
|
||||
make libjuice-gnutls.a : : @make_libjuice_gnutls ;
|
||||
make libjuice-openssl.a : : @make_libjuice_openssl ;
|
||||
make juice-static.lib : : @make_libjuice_msvc ;
|
||||
|
||||
rule make_libjuice ( targets * : sources * : properties * )
|
||||
rule make_libjuice_gnutls ( targets * : sources * : properties * )
|
||||
{
|
||||
local VARIANT = [ feature.get-values <variant> : $(properties) ] ;
|
||||
VARIANT on $(targets) = $(VARIANT) ;
|
||||
if <gnutls>on in $(properties)
|
||||
{
|
||||
BUILD_DIR on $(targets) = "build-gnutls-$(VARIANT)" ;
|
||||
CMAKEOPTS on $(targets) = "-DUSE_NETTLE=1" ;
|
||||
}
|
||||
else
|
||||
{
|
||||
local OPENSSL_INCLUDE = [ feature.get-values <openssl-include> : $(properties) ] ;
|
||||
|
||||
if <target-os>darwin in $(properties) && $(OPENSSL_INCLUDE) = ""
|
||||
{
|
||||
# on macOS, default to pick up openssl from the homebrew installation
|
||||
# brew install openssl
|
||||
OPENSSL_INCLUDE = /usr/local/opt/openssl/include ;
|
||||
}
|
||||
|
||||
BUILD_DIR on $(targets) = "build-openssl-$(VARIANT)" ;
|
||||
CMAKEOPTS on $(targets) = "-DUSE_NETTLE=0" ;
|
||||
if $(OPENSSL_INCLUDE) != ""
|
||||
{ CMAKEOPTS on $(targets) += " -DOPENSSL_ROOT_DIR=$(OPENSSL_INCLUDE)/.." ; }
|
||||
}
|
||||
BUILD_DIR on $(targets) = "build-gnutls-$(VARIANT)" ;
|
||||
CMAKEOPTS on $(targets) = "-DCMAKE_C_FLAGS=\"-fPIC\" -DCMAKE_BUILD_TYPE=$(VARIANT) -DUSE_NETTLE=1" ;
|
||||
}
|
||||
actions make_libjuice
|
||||
actions make_libjuice_gnutls
|
||||
{
|
||||
(cd $(CWD)/deps/libjuice && mkdir $(BUILD_DIR) && cd $(BUILD_DIR) && cmake -DCMAKE_C_FLAGS="-fPIC" -DCMAKE_BUILD_TYPE=$(VARIANT) $(CMAKEOPTS) .. && make -j2 juice-static)
|
||||
(cd $(CWD)/deps/libjuice && mkdir -p $(BUILD_DIR) && cd $(BUILD_DIR) && cmake $(CMAKEOPTS) .. && make -j2 juice-static)
|
||||
cp $(CWD)/deps/libjuice/$(BUILD_DIR)/libjuice-static.a $(<)
|
||||
}
|
||||
rule make_libjuice_openssl ( targets * : sources * : properties * )
|
||||
{
|
||||
local VARIANT = [ feature.get-values <variant> : $(properties) ] ;
|
||||
BUILD_DIR on $(targets) = "build-openssl-$(VARIANT)" ;
|
||||
CMAKEOPTS on $(targets) = "-DCMAKE_C_FLAGS=\"-fPIC\" -DCMAKE_BUILD_TYPE=$(VARIANT) -DUSE_NETTLE=0" ;
|
||||
|
||||
local OPENSSL_INCLUDE = [ feature.get-values <openssl-include> : $(properties) ] ;
|
||||
if <target-os>darwin in $(properties) && $(OPENSSL_INCLUDE) = ""
|
||||
{
|
||||
# on macOS, default to pick up openssl from the homebrew installation
|
||||
# brew install openssl
|
||||
OPENSSL_INCLUDE = /usr/local/opt/openssl/include ;
|
||||
}
|
||||
|
||||
if $(OPENSSL_INCLUDE) != ""
|
||||
{ CMAKEOPTS on $(targets) += " -DOPENSSL_ROOT_DIR=$(OPENSSL_INCLUDE)/.." ; }
|
||||
}
|
||||
actions make_libjuice_openssl
|
||||
{
|
||||
(cd $(CWD)/deps/libjuice && mkdir -p $(BUILD_DIR) && cd $(BUILD_DIR) && cmake $(CMAKEOPTS) .. && make -j2 juice-static)
|
||||
cp $(CWD)/deps/libjuice/$(BUILD_DIR)/libjuice-static.a $(<)
|
||||
}
|
||||
rule make_libjuice_msvc ( targets * : sources * : properties * )
|
||||
|
@ -21,15 +21,16 @@
|
||||
namespace rtc {
|
||||
|
||||
ThreadPool &ThreadPool::Instance() {
|
||||
static ThreadPool instance;
|
||||
return instance;
|
||||
// Init handles joining on cleanup
|
||||
static ThreadPool *instance = new ThreadPool;
|
||||
return *instance;
|
||||
}
|
||||
|
||||
ThreadPool::~ThreadPool() { join(); }
|
||||
|
||||
int ThreadPool::count() const {
|
||||
std::unique_lock lock(mWorkersMutex);
|
||||
return mWorkers.size();
|
||||
return int(mWorkers.size());
|
||||
}
|
||||
|
||||
void ThreadPool::spawn(int count) {
|
||||
|
Reference in New Issue
Block a user