mirror of
https://github.com/mii443/libdatachannel.git
synced 2025-08-22 15:15:28 +00:00
Compiling libsrtp inline
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -10,3 +10,6 @@
|
|||||||
[submodule "deps/json"]
|
[submodule "deps/json"]
|
||||||
path = deps/json
|
path = deps/json
|
||||||
url = https://github.com/nlohmann/json.git
|
url = https://github.com/nlohmann/json.git
|
||||||
|
[submodule "deps/libsrtp"]
|
||||||
|
path = deps/libsrtp
|
||||||
|
url = https://github.com/cisco/libsrtp.git
|
||||||
|
@ -161,25 +161,12 @@ if(WIN32)
|
|||||||
target_link_libraries(datachannel-static PRIVATE wsock32 ws2_32) # winsock2
|
target_link_libraries(datachannel-static PRIVATE wsock32 ws2_32) # winsock2
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(SRTP)
|
add_subdirectory(deps/libsrtp EXCLUDE_FROM_ALL)
|
||||||
if(SRTP_FOUND)
|
message(STATUS "LibSRTP found, compiling with media transport")
|
||||||
if(NOT TARGET SRTP::SRTP)
|
target_compile_definitions(datachannel PUBLIC RTC_ENABLE_MEDIA=1)
|
||||||
add_library(SRTP::SRTP UNKNOWN IMPORTED)
|
target_compile_definitions(datachannel-static PUBLIC RTC_ENABLE_MEDIA=1)
|
||||||
set_target_properties(SRTP::SRTP PROPERTIES
|
target_link_libraries(datachannel PRIVATE srtp2)
|
||||||
INTERFACE_INCLUDE_DIRECTORIES ${SRTP_INCLUDE_DIRS}
|
target_link_libraries(datachannel-static PRIVATE srtp2)
|
||||||
IMPORTED_LINK_INTERFACE_LANGUAGES C
|
|
||||||
IMPORTED_LOCATION ${SRTP_LIBRARIES})
|
|
||||||
endif()
|
|
||||||
message(STATUS "LibSRTP found, compiling with media transport")
|
|
||||||
target_compile_definitions(datachannel PUBLIC RTC_ENABLE_MEDIA=1)
|
|
||||||
target_compile_definitions(datachannel-static PUBLIC RTC_ENABLE_MEDIA=1)
|
|
||||||
target_link_libraries(datachannel PRIVATE SRTP::SRTP)
|
|
||||||
target_link_libraries(datachannel-static PRIVATE SRTP::SRTP)
|
|
||||||
else()
|
|
||||||
message(STATUS "LibSRTP NOT found, compiling WITHOUT media transport")
|
|
||||||
target_compile_definitions(datachannel PUBLIC RTC_ENABLE_MEDIA=0)
|
|
||||||
target_compile_definitions(datachannel-static PUBLIC RTC_ENABLE_MEDIA=0)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (USE_GNUTLS)
|
if (USE_GNUTLS)
|
||||||
find_package(GnuTLS REQUIRED)
|
find_package(GnuTLS REQUIRED)
|
||||||
|
1
deps/libsrtp
vendored
Submodule
1
deps/libsrtp
vendored
Submodule
Submodule deps/libsrtp added at 7d351de817
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
#if RTC_ENABLE_MEDIA
|
#if RTC_ENABLE_MEDIA
|
||||||
|
|
||||||
#include <srtp2/srtp.h>
|
#include "srtp.h"
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user