-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[libdatachannel] Add new port #13704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
strega-nil
merged 15 commits into
microsoft:master
from
Nemirtingas:libdatachannel_port
Nov 23, 2020
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
48ade4b
libdatachannel port
GameDumper ad8a4d2
Fixed various things for pr.
GameDumper f17cbb3
Merge branch 'master' of https://github.com/microsoft/vcpkg into libd…
53ada4e
Update to v0.9.2
GameDumper 9e8b931
Merge branch 'libdatachannel_port' of https://github.com/Nemirtingas/…
GameDumper 2ed77e2
Update to 0.9.4 and enable SRTP feature
GameDumper 1d6485d
Merge branch 'master' of https://github.com/microsoft/vcpkg into libd…
71a221a
Merge branch 'master' into libdatachannel_port
GameDumper 59e1c5b
Add openssl dependency
GameDumper 9c6c58c
Fix usrsctp find_library
GameDumper c084b5f
Merge remote-tracking branch 'origin/master' into HEAD
BillyONeal bba6833
Flip the sense of the websockets feature and use a manifest instead o…
BillyONeal 650e7cb
Need to update libjuice and libdatachannel but there is now a USE_SRT…
GameDumper d7313ce
Update libdatachannel for USE_SRTP Option
GameDumper 8d16270
Update libdatachannel to v0.10.1
GameDumper File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| index bed634b..fced56e 100644 | ||
| --- a/CMakeLists.txt | ||
| +++ b/CMakeLists.txt | ||
| @@ -112,28 +112,18 @@ set(THREADS_PREFER_PTHREAD_FLAG TRUE) | ||
| find_package(Threads REQUIRED) | ||
|
|
||
| set(CMAKE_POLICY_DEFAULT_CMP0048 NEW) | ||
| -add_subdirectory(deps/plog) | ||
| - | ||
| -option(sctp_build_programs 0) | ||
| -option(sctp_build_shared_lib 0) | ||
| -add_subdirectory(deps/usrsctp EXCLUDE_FROM_ALL) | ||
| -if (MSYS OR MINGW) | ||
| - target_compile_definitions(usrsctp PUBLIC -DSCTP_STDINT_INCLUDE=<stdint.h>) | ||
| -endif() | ||
| -if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") | ||
| - target_compile_options(usrsctp PRIVATE -Wno-error=format-truncation) | ||
| -endif() | ||
| -add_library(Usrsctp::Usrsctp ALIAS usrsctp) | ||
| +find_library(USRSCTP_LIBRARY usrsctp REQUIRED) | ||
| +find_path(PLOG_INCLUDE_DIRS "plog/Appenders/AndroidAppender.h") | ||
|
|
||
| if (NO_WEBSOCKET) | ||
| - add_library(datachannel SHARED | ||
| + add_library(datachannel | ||
| ${LIBDATACHANNEL_SOURCES}) | ||
| add_library(datachannel-static STATIC EXCLUDE_FROM_ALL | ||
| ${LIBDATACHANNEL_SOURCES}) | ||
| target_compile_definitions(datachannel PUBLIC RTC_ENABLE_WEBSOCKET=0) | ||
| target_compile_definitions(datachannel-static PUBLIC RTC_ENABLE_WEBSOCKET=0) | ||
| else() | ||
| - add_library(datachannel SHARED | ||
| + add_library(datachannel | ||
| ${LIBDATACHANNEL_SOURCES} | ||
| ${LIBDATACHANNEL_WEBSOCKET_SOURCES}) | ||
| add_library(datachannel-static STATIC EXCLUDE_FROM_ALL | ||
| @@ -150,17 +140,17 @@ set_target_properties(datachannel-static PROPERTIES | ||
| VERSION ${PROJECT_VERSION} | ||
| CXX_STANDARD 17) | ||
|
|
||
| -target_include_directories(datachannel PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) | ||
| +target_include_directories(datachannel PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>) | ||
| target_include_directories(datachannel PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/rtc) | ||
| target_include_directories(datachannel PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src) | ||
| -target_link_libraries(datachannel PUBLIC Threads::Threads plog::plog) | ||
| -target_link_libraries(datachannel PRIVATE Usrsctp::Usrsctp) | ||
| +target_include_directories(datachannel PRIVATE ${PLOG_INCLUDE_DIRS}) | ||
| +target_link_libraries(datachannel PUBLIC Threads::Threads ${USRSCTP_LIBRARY}) | ||
|
|
||
| target_include_directories(datachannel-static PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) | ||
| target_include_directories(datachannel-static PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/rtc) | ||
| target_include_directories(datachannel-static PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src) | ||
| -target_link_libraries(datachannel-static PUBLIC Threads::Threads plog::plog) | ||
| -target_link_libraries(datachannel-static PRIVATE Usrsctp::Usrsctp) | ||
| +target_include_directories(datachannel-static PRIVATE ${PLOG_INCLUDE_DIRS}) | ||
| +target_link_libraries(datachannel-static PUBLIC Threads::Threads ${USRSCTP_LIBRARY}) | ||
|
|
||
| if(WIN32) | ||
| target_link_libraries(datachannel PRIVATE ws2_32) # winsock2 | ||
| @@ -224,11 +214,11 @@ if (USE_NICE OR NOT USE_JUICE) | ||
| target_link_libraries(datachannel PRIVATE LibNice::LibNice) | ||
| target_link_libraries(datachannel-static PRIVATE LibNice::LibNice) | ||
| else() | ||
| - add_subdirectory(deps/libjuice EXCLUDE_FROM_ALL) | ||
| + find_package(libjuice CONFIG REQUIRED) | ||
| target_compile_definitions(datachannel PRIVATE USE_NICE=0) | ||
| target_compile_definitions(datachannel-static PRIVATE USE_NICE=0) | ||
| - target_link_libraries(datachannel PRIVATE LibJuice::LibJuiceStatic) | ||
| - target_link_libraries(datachannel-static PRIVATE LibJuice::LibJuiceStatic) | ||
| + target_link_libraries(datachannel PRIVATE LibJuice::juice) | ||
| + target_link_libraries(datachannel-static PRIVATE LibJuice::juice) | ||
| endif() | ||
|
|
||
| if(RSA_KEY_BITS_2048) | ||
| @@ -244,7 +234,11 @@ endif() | ||
| add_library(LibDataChannel::LibDataChannel ALIAS datachannel) | ||
| add_library(LibDataChannel::LibDataChannelStatic ALIAS datachannel-static) | ||
|
|
||
| -install(TARGETS datachannel LIBRARY DESTINATION lib) | ||
| +install(TARGETS datachannel EXPORT libdatachannel-config | ||
| + RUNTIME DESTINATION bin | ||
| + LIBRARY DESTINATION lib | ||
| + ARCHIVE DESTINATION lib | ||
| +) | ||
| install(FILES ${LIBDATACHANNEL_HEADERS} DESTINATION include/rtc) | ||
|
|
||
| if(NOT MSVC) | ||
| @@ -306,3 +300,8 @@ if(NOT NO_EXAMPLES AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") | ||
| add_subdirectory(examples/copy-paste-capi) | ||
| endif() | ||
|
|
||
| +install( | ||
| + EXPORT libdatachannel-config | ||
| + NAMESPACE LibDatachannel:: | ||
| + DESTINATION share/cmake/libdatachannel | ||
| +) | ||
| diff --git a/src/tcptransport.hpp b/src/tcptransport.hpp | ||
| index 1447835..1c92686 100644 | ||
| --- a/src/tcptransport.hpp | ||
| +++ b/src/tcptransport.hpp | ||
| @@ -29,7 +29,7 @@ | ||
| #include <thread> | ||
|
|
||
| // Use the socket defines from libjuice | ||
| -#include "../deps/libjuice/src/socket.h" | ||
| +#include <juice/src/socket.h> | ||
|
|
||
| namespace rtc { | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| vcpkg_from_github( | ||
| OUT_SOURCE_PATH SOURCE_PATH | ||
| REPO paullouisageneau/libdatachannel | ||
| REF v0.10.1 | ||
| SHA512 195f564776b2a7ab6fe3a838d55be7fa03b72a5f08faaba5ddefac59ae1fff28f3ee0b9ed5dc17a7ef9155a1d30a61f8c593f2a108f60e415ffd213188e081bd | ||
| HEAD_REF master | ||
| PATCHES | ||
| fix-for-vcpkg.patch | ||
| ) | ||
|
|
||
| vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS | ||
| INVERTED_FEATURES | ||
| ws NO_WEBSOCKET | ||
| srtp NO_MEDIA | ||
| ) | ||
|
|
||
| vcpkg_configure_cmake( | ||
| SOURCE_PATH ${SOURCE_PATH} | ||
| PREFER_NINJA | ||
| OPTIONS | ||
| ${FEATURE_OPTIONS} | ||
| -DUSE_SYSTEM_SRTP=ON | ||
| -DNO_EXAMPLES=ON | ||
| -DNO_TESTS=ON | ||
| ) | ||
|
|
||
| vcpkg_install_cmake() | ||
|
|
||
| file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") | ||
|
|
||
| vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/libdatachannel) | ||
| vcpkg_fixup_pkgconfig() | ||
|
|
||
| file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| { | ||
| "name": "libdatachannel", | ||
| "version-string": "v0.10.1", | ||
| "description": "libdatachannel is a standalone implementation of WebRTC Data Channels, WebRTC Media Transport, and WebSockets in C++17 with C bindings for POSIX platforms (including GNU/Linux, Android, and Apple macOS) and Microsoft Windows.", | ||
| "homepage": "https://github.com/paullouisageneau/libdatachannel", | ||
| "dependencies": [ | ||
| "libjuice", | ||
| "openssl", | ||
| "plog", | ||
| "usrsctp" | ||
| ], | ||
| "default-features": [ | ||
| "ws" | ||
| ], | ||
| "features": { | ||
| "srtp": { | ||
| "description": "Use Cisco's libSRTP for media transport.", | ||
| "dependencies": [ | ||
| "libsrtp" | ||
| ] | ||
| }, | ||
| "ws": { | ||
| "description": "Web Socket support" | ||
| } | ||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.