mirror of
https://github.com/mii443/libdatachannel.git
synced 2025-08-23 15:48:03 +00:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
be6470d8bc | |||
8a92c97058 | |||
93da605230 | |||
ff0f409d80 | |||
a483e8135b | |||
36e4fdce1e |
6
.gitmodules
vendored
6
.gitmodules
vendored
@ -1,9 +1,9 @@
|
||||
[submodule "usrsctp"]
|
||||
path = deps/usrsctp
|
||||
url = https://github.com/sctplab/usrsctp.git
|
||||
[submodule "deps/plog"]
|
||||
path = deps/plog
|
||||
url = https://github.com/SergiusTheBest/plog
|
||||
[submodule "usrsctp"]
|
||||
path = deps/usrsctp
|
||||
url = https://github.com/sctplab/usrsctp.git
|
||||
[submodule "deps/libjuice"]
|
||||
path = deps/libjuice
|
||||
url = https://github.com/paullouisageneau/libjuice
|
||||
|
@ -1,7 +1,7 @@
|
||||
cmake_minimum_required (VERSION 3.7)
|
||||
project (libdatachannel
|
||||
DESCRIPTION "WebRTC Data Channels Library"
|
||||
VERSION 0.4.0
|
||||
DESCRIPTION "WebRTC DataChannels Library"
|
||||
VERSION 0.4.2
|
||||
LANGUAGES CXX)
|
||||
|
||||
option(USE_GNUTLS "Use GnuTLS instead of OpenSSL" OFF)
|
||||
@ -42,38 +42,13 @@ set(TESTS_ANSWERER_SOURCES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test/p2p/answerer.cpp
|
||||
)
|
||||
|
||||
|
||||
# Hack because usrsctp uses CMAKE_SOURCE_DIR instead of CMAKE_CURRENT_SOURCE_DIR
|
||||
set(CMAKE_REQUIRED_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}/deps/usrsctp/usrsctplib")
|
||||
|
||||
add_subdirectory(deps/usrsctp EXCLUDE_FROM_ALL)
|
||||
|
||||
# Set include directory and custom options to make usrsctp compile with recent g++
|
||||
target_include_directories(usrsctp-static PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/deps/usrsctp/usrsctplib)
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
# using regular Clang or AppleClang: Needed since they don't have -Wno-error=format-truncation
|
||||
target_compile_options(usrsctp-static PRIVATE -Wno-error=address-of-packed-member)
|
||||
else()
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.0")
|
||||
# GCC version below 9.0 does not support option address-of-packed-member
|
||||
target_compile_options(usrsctp-static PRIVATE -Wno-error=format-truncation)
|
||||
else()
|
||||
target_compile_options(usrsctp-static PRIVATE -Wno-error=address-of-packed-member -Wno-error=format-truncation)
|
||||
endif()
|
||||
else()
|
||||
# all other compilers
|
||||
target_compile_options(usrsctp-static PRIVATE -Wno-error=address-of-packed-member -Wno-error=format-truncation)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_library(Usrsctp::Usrsctp ALIAS usrsctp)
|
||||
add_library(Usrsctp::UsrsctpStatic ALIAS usrsctp-static)
|
||||
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
add_subdirectory(deps/usrsctp EXCLUDE_FROM_ALL)
|
||||
add_library(Usrsctp::Usrsctp ALIAS usrsctp)
|
||||
add_library(Usrsctp::UsrsctpStatic ALIAS usrsctp-static)
|
||||
|
||||
add_library(datachannel SHARED ${LIBDATACHANNEL_SOURCES})
|
||||
set_target_properties(datachannel PROPERTIES
|
||||
VERSION ${PROJECT_VERSION}
|
||||
|
2
Makefile
2
Makefile
@ -4,8 +4,8 @@ NAME=libdatachannel
|
||||
CXX=$(CROSS)g++
|
||||
AR=$(CROSS)ar
|
||||
RM=rm -f
|
||||
CPPFLAGS=-O2 -pthread -fPIC -Wall -Wno-address-of-packed-member
|
||||
CXXFLAGS=-std=c++17
|
||||
CPPFLAGS=-O2 -pthread -fPIC -Wall -Wno-address-of-packed-member
|
||||
LDFLAGS=-pthread
|
||||
LIBS=
|
||||
LOCALLIBS=libusrsctp.a
|
||||
|
10
README.md
10
README.md
@ -17,13 +17,14 @@ The library aims at fully implementing WebRTC SCTP DataChannels ([draft-ietf-rtc
|
||||
- GnuTLS: https://www.gnutls.org/ or OpenSSL: https://www.openssl.org/
|
||||
|
||||
Optional:
|
||||
- libnice: https://github.com/libnice/libnice (substituable with libjuice)
|
||||
- libnice: https://nice.freedesktop.org/ (substituable with libjuice)
|
||||
|
||||
Submodules:
|
||||
- usrsctp: https://github.com/sctplab/usrsctp
|
||||
- libjuice: https://github.com/paullouisageneau/libjuice
|
||||
|
||||
## Building
|
||||
### Building with CMake (preferred)
|
||||
|
||||
```bash
|
||||
$ git submodule update --init --recursive
|
||||
@ -33,6 +34,13 @@ $ cmake -DUSE_JUICE=1 -DUSE_GNUTLS=1 ..
|
||||
$ make
|
||||
```
|
||||
|
||||
### Building directly with Make
|
||||
|
||||
```bash
|
||||
$ git submodule update --init --recursive
|
||||
$ make USE_JUICE=1 USE_GNUTLS=1
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
In the following example, note the callbacks are called in another thread.
|
||||
|
2
deps/libjuice
vendored
2
deps/libjuice
vendored
Submodule deps/libjuice updated: eb94240844...65f492dbff
2
deps/usrsctp
vendored
2
deps/usrsctp
vendored
Submodule deps/usrsctp updated: 04d617c9c1...aa10d60bc2
Reference in New Issue
Block a user