Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
ZLMediaKit
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
张翔宇
ZLMediaKit
Commits
9ea98642
Unverified
Commit
9ea98642
authored
Jul 29, 2022
by
Xiaofeng Wang
Committed by
GitHub
Jul 29, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1837 from wasphin/feature/cmake-fix-sctp
修正启用 SCTP 后编译问题
parents
d0f0c69f
b1ccbcc4
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
13 行增加
和
5 行删除
+13
-5
.github/workflows/linux.yml
+1
-1
webrtc/CMakeLists.txt
+12
-4
没有找到文件。
.github/workflows/linux.yml
查看文件 @
9ea98642
...
@@ -14,7 +14,7 @@ jobs:
...
@@ -14,7 +14,7 @@ jobs:
run
:
mv -f .gitmodules_github .gitmodules && git submodule sync && git submodule update --init
run
:
mv -f .gitmodules_github .gitmodules && git submodule sync && git submodule update --init
-
name
:
apt-get安装依赖库(非必选)
-
name
:
apt-get安装依赖库(非必选)
run
:
sudo apt-get update && sudo apt-get install -y cmake libssl-dev libsdl-dev libavcodec-dev libavutil-dev libswscale-dev libresample-dev
run
:
sudo apt-get update && sudo apt-get install -y cmake libssl-dev libsdl-dev libavcodec-dev libavutil-dev libswscale-dev libresample-dev
libusrsctp-dev
-
name
:
下载 SRTP
-
name
:
下载 SRTP
uses
:
actions/checkout@v2
uses
:
actions/checkout@v2
...
...
webrtc/CMakeLists.txt
查看文件 @
9ea98642
...
@@ -35,12 +35,17 @@ include_directories(SYSTEM ${SRTP_INCLUDE_DIRS})
...
@@ -35,12 +35,17 @@ include_directories(SYSTEM ${SRTP_INCLUDE_DIRS})
set
(
LINK_LIBRARIES
${
SRTP_LIBRARIES
}
)
set
(
LINK_LIBRARIES
${
SRTP_LIBRARIES
}
)
set
(
COMPILE_DEFINITIONS
)
set
(
INCLUDE_DIRECTORIES
)
find_package
(
SCTP QUIET
)
find_package
(
SCTP QUIET
)
if
(
SCTP_FOUND
)
if
(
SCTP_FOUND
)
message
(
STATUS
"found library:
${
SCTP_INCLUDE_DIRS
}
${
SCTP_LIBRARIES
}
"
)
message
(
STATUS
"found library:
${
SCTP_INCLUDE_DIRS
}
${
SCTP_LIBRARIES
}
"
)
include_directories
(
SYSTEM
${
SCTP_INCLUDE_DIRS
}
)
include_directories
(
SYSTEM
${
SCTP_INCLUDE_DIRS
}
)
update_cached_list
(
MK_COMPILE_DEFINITIONS ENABLE_SCTP
)
# TODO: 避免暴露 SCTP 到 WebRTC 模块外
update_cached_list
(
LINK_LIBRARIES
${
SCTP_LIBRARIES
}
)
list
(
APPEND COMPILE_DEFINITIONS ENABLE_SCTP
)
list
(
APPEND INCLUDE_DIRECTORIES
${
SCTP_INCLUDE_DIRS
}
)
list
(
APPEND LINK_LIBRARIES
${
SCTP_LIBRARIES
}
)
message
(
STATUS
"WebRTC datachannel 功能已打开"
)
message
(
STATUS
"WebRTC datachannel 功能已打开"
)
endif
()
endif
()
...
@@ -50,19 +55,22 @@ file(GLOB WEBRTC_SRC_LIST
...
@@ -50,19 +55,22 @@ file(GLOB WEBRTC_SRC_LIST
${
CMAKE_CURRENT_SOURCE_DIR
}
/*.hpp
)
${
CMAKE_CURRENT_SOURCE_DIR
}
/*.hpp
)
add_library
(
webrtc
${
WEBRTC_SRC_LIST
}
)
add_library
(
webrtc
${
WEBRTC_SRC_LIST
}
)
add_library
(
ZLMediaKit::WebRTC ALIAS webrtc
)
add_library
(
ZLMediaKit::WebRTC ALIAS webrtc
)
target_compile_definitions
(
webrtc
# ENABLE_SCTP 暂时需要暴露
PUBLIC
${
COMPILE_DEFINITIONS
}
)
target_compile_options
(
webrtc
target_compile_options
(
webrtc
PRIVATE
${
COMPILE_OPTIONS_DEFAULT
}
)
PRIVATE
${
COMPILE_OPTIONS_DEFAULT
}
)
target_link_libraries
(
webrtc
target_link_libraries
(
webrtc
PRIVATE
PRIVATE
ZLMediaKit::MediaKit
ZLMediaKit::MediaKit
ZLMediaKit::ToolKit
ZLMediaKit::ToolKit
PUBLIC
${
LINK_LIBRARIES
}
)
${
LINK_LIBRARIES
}
)
target_include_directories
(
webrtc
target_include_directories
(
webrtc
PRIVATE
PRIVATE
"$<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
>"
"$<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
>"
PUBLIC
PUBLIC
"$<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/..>"
)
"$<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/..>"
${
INCLUDE_DIRECTORIES
}
)
message
(
STATUS
"WebRTC 功能已开启"
)
message
(
STATUS
"WebRTC 功能已开启"
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论