[libdatachannel] Drop unused dep, fix DLL install, add test port (#40439)

This commit is contained in:
Kai Pastor 2024-08-22 11:54:39 +02:00 committed by GitHub
parent 62aab9d3d8
commit e9f935a8e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 80 additions and 3 deletions

View File

@ -1,8 +1,16 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b35e4b1..1b5190b 100644
index b35e4b1..b052d02 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -457,11 +457,17 @@ if(WARNINGS_AS_ERRORS)
@@ -48,7 +48,6 @@ endif()
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
-set(BUILD_SHARED_LIBS OFF) # to force usrsctp to be built static
if(WIN32)
add_definitions(-DWIN32_LEAN_AND_MEAN)
@@ -457,11 +456,17 @@ if(WARNINGS_AS_ERRORS)
endif()
endif()

View File

@ -33,6 +33,7 @@ vcpkg_fixup_pkgconfig()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/rtc/common.hpp" "#ifdef RTC_STATIC" "#if 1")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/rtc/rtc.h" "#ifdef RTC_STATIC" "#if 1")
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")

View File

@ -1,6 +1,7 @@
{
"name": "libdatachannel",
"version-semver": "0.21.2",
"port-version": 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",
"license": "MPL-2.0",

View File

@ -0,0 +1,29 @@
diff --git a/examples/streamer/CMakeLists.txt b/examples/streamer/CMakeLists.txt
index 1bdeb7c..9cf65dd 100644
--- a/examples/streamer/CMakeLists.txt
+++ b/examples/streamer/CMakeLists.txt
@@ -2,6 +2,15 @@ cmake_minimum_required(VERSION 3.7)
if(POLICY CMP0079)
cmake_policy(SET CMP0079 NEW)
endif()
+project(vcpkg-ci)
+add_definitions(-DWIN32_LEAN_AND_MEAN)
+set(THREADS_PREFER_PTHREAD_FLAG ON)
+find_package(Threads REQUIRED)
+find_package(nlohmann_json CONFIG REQUIRED)
+find_package(LibDataChannel CONFIG REQUIRED)
+if(NOT TARGET LibDataChannel::LibDataChannel)
+ add_library(LibDataChannel::LibDataChannel ALIAS LibDataChannel::LibDataChannelStatic)
+endif()
set(STREAMER_SOURCES
main.cpp
@@ -47,7 +56,7 @@ set_target_properties(streamer PROPERTIES
find_package(Threads REQUIRED)
target_link_libraries(streamer LibDataChannel::LibDataChannel Threads::Threads nlohmann_json::nlohmann_json)
-if(MSVC)
+if(0)
add_custom_command(TARGET streamer POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"$<TARGET_FILE_DIR:datachannel>/datachannel.dll"

View File

@ -0,0 +1,14 @@
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO paullouisageneau/libdatachannel
REF v0.21.2
SHA512 fd0d66bb932e29abc01e9f1a8b16ccb79012a7e3901e2e0f882f56ab2f090260945e1556c85ad07ef897b8c70fcdd44cdeead9955a9bca7afe1dda8900c473cc
HEAD_REF master
PATCHES
cmake-project.diff
)
vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}/examples/streamer")
vcpkg_cmake_build()

View File

@ -0,0 +1,19 @@
{
"name": "vcpkg-ci-libdatachannel",
"version-string": "ci",
"description": "Validates libdatachannel",
"dependencies": [
{
"name": "libdatachannel",
"features": [
"srtp",
"ws"
]
},
"nlohmann-json",
{
"name": "vcpkg-cmake",
"host": true
}
]
}

View File

@ -4350,7 +4350,7 @@
},
"libdatachannel": {
"baseline": "0.21.2",
"port-version": 0
"port-version": 1
},
"libdatrie": {
"baseline": "0.2.13",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "df0663ab881ed7a331bf51b6bf652e80fc55dbf4",
"version-semver": "0.21.2",
"port-version": 1
},
{
"git-tree": "7ef5c0cdf31856f7b73f1498dd8055627608801c",
"version-semver": "0.21.2",