-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libdatachannel] Update, cleanup (#40337)
- Loading branch information
Showing
10 changed files
with
111 additions
and
124 deletions.
There are no files selected for viewing
This file contains 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,63 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 8a61757..b35e4b1 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -234,7 +234,7 @@ set(THREADS_PREFER_PTHREAD_FLAG TRUE) | ||
find_package(Threads REQUIRED) | ||
|
||
if(USE_SYSTEM_PLOG) | ||
- find_package(plog REQUIRED) | ||
+ find_package(plog CONFIG REQUIRED) | ||
else() | ||
set(CMAKE_POLICY_DEFAULT_CMP0048 NEW) | ||
add_subdirectory(deps/plog EXCLUDE_FROM_ALL) | ||
@@ -245,7 +245,8 @@ if(SCTP_DEBUG) | ||
endif() | ||
|
||
if(USE_SYSTEM_USRSCTP) | ||
- find_package(Usrsctp REQUIRED) | ||
+ find_package(unofficial-usrsctp CONFIG REQUIRED) | ||
+ add_library(Usrsctp::Usrsctp ALIAS unofficial::usrsctp::usrsctp) | ||
else() | ||
option(sctp_build_shared_lib OFF) | ||
option(sctp_build_programs OFF) | ||
@@ -331,7 +332,7 @@ else() | ||
target_compile_definitions(datachannel PUBLIC RTC_ENABLE_MEDIA=1) | ||
target_compile_definitions(datachannel-static PUBLIC RTC_ENABLE_MEDIA=1) | ||
if(USE_SYSTEM_SRTP) | ||
- find_package(libSRTP REQUIRED) | ||
+ find_package(libSRTP CONFIG REQUIRED) | ||
if(NOT TARGET libSRTP::srtp2) | ||
add_library(libSRTP::srtp2 UNKNOWN IMPORTED) | ||
set_target_properties(libSRTP::srtp2 PROPERTIES | ||
@@ -475,8 +476,9 @@ install( | ||
) | ||
|
||
# Export config | ||
+configure_file(cmake/LibDataChannelConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/cmake/LibDataChannelConfig.cmake @ONLY) | ||
install( | ||
- FILES ${CMAKE_CURRENT_SOURCE_DIR}/cmake/LibDataChannelConfig.cmake | ||
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/cmake/LibDataChannelConfig.cmake | ||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LibDataChannel | ||
) | ||
|
||
diff --git a/cmake/LibDataChannelConfig.cmake b/cmake/LibDataChannelConfig.cmake | ||
index cb2b884..d0b77ca 100644 | ||
--- a/cmake/LibDataChannelConfig.cmake | ||
+++ b/cmake/LibDataChannelConfig.cmake | ||
@@ -1,2 +1,15 @@ | ||
+if(NOT "@BUILD_SHARED_LIBS@") | ||
+ include(CMakeFindDependencyMacro) | ||
+ set(THREADS_PREFER_PTHREAD_FLAG ON) | ||
+ find_dependency(Threads) | ||
+ find_dependency(plog CONFIG) | ||
+ find_dependency(unofficial-usrsctp CONFIG) | ||
+ if(NOT "@NO_MEDIA@") | ||
+ find_dependency(libSRTP CONFIG) | ||
+ endif() | ||
+ find_dependency(OpenSSL) | ||
+ find_dependency(LibJuice) | ||
+endif() | ||
+ | ||
include("${CMAKE_CURRENT_LIST_DIR}/LibDataChannelTargets.cmake") | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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,22 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index b35e4b1..1b5190b 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -457,11 +457,17 @@ if(WARNINGS_AS_ERRORS) | ||
endif() | ||
endif() | ||
|
||
+if(BUILD_SHARED_LIBS) | ||
install(TARGETS datachannel EXPORT LibDataChannelTargets | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
) | ||
+else() | ||
+ set_target_properties(datachannel PROPERTIES EXCLUDE_FROM_ALL 1) | ||
+ set_target_properties(datachannel-static PROPERTIES EXCLUDE_FROM_ALL 0) | ||
+ install(TARGETS datachannel-static EXPORT LibDataChannelTargets) | ||
+endif() | ||
|
||
install(FILES ${LIBDATACHANNEL_HEADERS} | ||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rtc |
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,14 +1,15 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 2c34d7fb..1bedd212 100644 | ||
index 1b5190b..763b49e 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -446,6 +446,9 @@ if(WARNINGS_AS_ERRORS) | ||
endif() | ||
@@ -315,6 +315,10 @@ target_link_libraries(datachannel-static PRIVATE Usrsctp::Usrsctp plog::plog) | ||
if(WIN32) | ||
target_link_libraries(datachannel PUBLIC ws2_32) # winsock2 | ||
target_link_libraries(datachannel-static PUBLIC ws2_32) # winsock2 | ||
+ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") | ||
+ target_compile_options(datachannel PRIVATE /wd4996) | ||
+ target_compile_options(datachannel-static PRIVATE /wd4996) | ||
+ endif() | ||
endif() | ||
|
||
+target_compile_options(datachannel PRIVATE /wd4996) | ||
+target_compile_options(datachannel-static PRIVATE /wd4996) | ||
+ | ||
if(DATACHANNEL_STATIC_LINKAGE) | ||
set_target_properties(datachannel PROPERTIES EXCLUDE_FROM_ALL 1) | ||
set_target_properties(datachannel-static PROPERTIES EXCLUDE_FROM_ALL 0) | ||
if (NO_WEBSOCKET) |
This file contains 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
This file contains 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
This file contains 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