Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
b5c8989b
提交
b5c8989b
authored
1月 13, 2022
作者:
Nazar Mokrynskyi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Replace manual build artifacts management with Meson commands
上级
812d74c1
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
43 行增加
和
47 行删除
+43
-47
Cargo.toml
worker/Cargo.toml
+1
-1
Makefile
worker/Makefile
+28
-14
build.rs
worker/build.rs
+6
-32
meson.build
worker/meson.build
+8
-0
没有找到文件。
worker/Cargo.toml
浏览文件 @
b5c8989b
[package]
name
=
"mediasoup-sys"
version
=
"0.3.
1
"
version
=
"0.3.
2
"
description
=
"FFI bindings to C++ libmediasoup-worker"
authors
=
[
"Nazar Mokrynskyi <nazar@mokrynskyi.com>"
]
edition
=
"2018"
...
...
worker/Makefile
浏览文件 @
b5c8989b
...
...
@@ -12,6 +12,7 @@ GULP = ./scripts/node_modules/.bin/gulp
LCOV
=
./deps/lcov/bin/lcov
DOCKER
?=
docker
PIP_DIR
=
$(MEDIASOUP_OUT_DIR)
/pip
INSTALL_DIR
?=
$(MEDIASOUP_OUT_DIR)
/
$(MEDIASOUP_BUILDTYPE)
BUILD_DIR
?=
$(MEDIASOUP_OUT_DIR)
/
$(MEDIASOUP_BUILDTYPE)
/build
MESON
?=
$(PIP_DIR)
/bin/meson
MESON_ARGS
?=
""
...
...
@@ -71,6 +72,9 @@ setup: meson-ninja
# https://github.com/ninja-build/ninja/issues/1997
ifeq
($(MEDIASOUP_BUILDTYPE),Release)
$(MESON)
setup
\
--prefix
$(INSTALL_DIR)
\
--bindir
''
\
--libdir
''
\
--buildtype
release
\
-Db_ndebug
=
true
\
-Db_pie
=
true
\
...
...
@@ -79,6 +83,9 @@ ifeq ($(MEDIASOUP_BUILDTYPE),Release)
$(MESON_ARGS)
\
$(BUILD_DIR)
||
\
$(MESON)
setup
\
--prefix
$(INSTALL_DIR)
\
--bindir
''
\
--libdir
''
\
--buildtype
release
\
-Db_ndebug
=
true
\
-Db_pie
=
true
\
...
...
@@ -88,6 +95,9 @@ ifeq ($(MEDIASOUP_BUILDTYPE),Release)
else
ifeq
($(MEDIASOUP_BUILDTYPE),Debug)
$(MESON)
setup
\
--prefix
$(INSTALL_DIR)
\
--bindir
''
\
--libdir
''
\
--buildtype
debug
\
-Db_pie
=
true
\
-Db_staticpic
=
true
\
...
...
@@ -95,6 +105,9 @@ ifeq ($(MEDIASOUP_BUILDTYPE),Debug)
$(MESON_ARGS)
\
$(BUILD_DIR)
||
\
$(MESON)
setup
\
--prefix
$(INSTALL_DIR)
\
--bindir
''
\
--libdir
''
\
--buildtype
debug
\
-Db_pie
=
true
\
-Db_staticpic
=
true
\
...
...
@@ -102,6 +115,9 @@ ifeq ($(MEDIASOUP_BUILDTYPE),Debug)
$(BUILD_DIR)
else
$(MESON)
setup
\
--prefix
$(INSTALL_DIR)
\
--bindir
''
\
--libdir
''
\
--buildtype
$(MEDIASOUP_BUILDTYPE)
\
-Db_ndebug
=
if
-release
\
-Db_pie
=
true
\
...
...
@@ -110,6 +126,9 @@ else
$(MESON_ARGS)
\
$(BUILD_DIR)
||
\
$(MESON)
setup
\
--prefix
$(INSTALL_DIR)
\
--bindir
''
\
--libdir
''
\
--buildtype
$(MEDIASOUP_BUILDTYPE)
\
-Db_ndebug
=
if
-release
\
-Db_pie
=
true
\
...
...
@@ -120,7 +139,7 @@ endif
endif
clean
:
$(RM)
-rf
$(
MEDIASOUP_OUT_DIR)
/
$(MEDIASOUP_BUILDTYPE
)
$(RM)
-rf
$(
INSTALL_DIR
)
clean-build
:
$(RM)
-rf
$(BUILD_DIR)
...
...
@@ -136,12 +155,8 @@ clean-all: clean-subprojects
mediasoup-worker
:
setup
ifeq
($(MEDIASOUP_WORKER_BIN),)
$(MESON)
compile
-j
$(CORES)
-C
$(BUILD_DIR)
mediasoup-worker
endif
ifeq
($(OS),Windows_NT)
cp
$(BUILD_DIR)/mediasoup-worker.exe
$(MEDIASOUP_OUT_DIR)/$(MEDIASOUP_BUILDTYPE)/mediasoup-worker.exe
else
cp
$(BUILD_DIR)/mediasoup-worker
$(MEDIASOUP_OUT_DIR)/$(MEDIASOUP_BUILDTYPE)/mediasoup-worker
$(MESON)
compile
-C
$(BUILD_DIR)
-j
$(CORES)
mediasoup-worker
$(MESON)
install
-C
$(BUILD_DIR)
--no-rebuild
--tags
mediasoup-worker
endif
xcode
:
setup
...
...
@@ -154,8 +169,8 @@ format:
$(GULP)
--gulpfile
./scripts/gulpfile.js format:worker
test
:
setup
ifeq
($(MEDIASOUP_WORKER_BIN),)
$(MESON)
compile
-j
$(CORES)
-C
$(BUILD_DIR)
mediasoup-worker-test
$(MESON)
compile
-C
$(BUILD_DIR)
-j
$(CORES)
mediasoup-worker-test
$(MESON)
install
-C
$(BUILD_DIR)
--no-rebuild
--tags
mediasoup-worker-test
# On Windows lcov doesn't work
(
at least not yet
)
and we need to add
`
.exe
`
to
# the binary path.
ifeq
($(OS),Windows_NT)
...
...
@@ -164,7 +179,6 @@ else
$(LCOV)
--directory
./
--zerocounters
$(BUILD_DIR)/mediasoup-worker-test
--invisibles
--use-colour
=
yes
$(MEDIASOUP_TEST_TAGS)
endif
endif
tidy
:
$(PYTHON)
./scripts/clang-tidy.py
\
...
...
@@ -177,9 +191,8 @@ tidy:
-quiet
fuzzer
:
setup
ifeq
($(MEDIASOUP_WORKER_BIN),)
$(MESON)
compile
-j
$(CORES)
-C
$(BUILD_DIR)
mediasoup-worker-fuzzer
endif
$(MESON)
compile
-C
$(BUILD_DIR)
-j
$(CORES)
mediasoup-worker-fuzzer
$(MESON)
install
-C
$(BUILD_DIR)
--no-rebuild
--tags
mediasoup-worker-fuzzer
fuzzer-run-all
:
LSAN_OPTIONS
=
verbosity
=
1:log_threads
=
1 ./
$(BUILD_DIR)
/mediasoup-worker-fuzzer
-artifact_prefix
=
fuzzer/reports/
-max_len
=
1400 fuzzer/new-corpus deps/webrtc-fuzzer-corpora/corpora/stun-corpus deps/webrtc-fuzzer-corpora/corpora/rtp-corpus deps/webrtc-fuzzer-corpora/corpora/rtcp-corpus
...
...
@@ -200,4 +213,5 @@ docker-run:
mediasoup/docker:latest
libmediasoup-worker
:
setup
$(MESON)
compile
-j
$(CORES)
-C
$(BUILD_DIR)
libmediasoup-worker
$(MESON)
compile
-C
$(BUILD_DIR)
-j
$(CORES)
libmediasoup-worker
$(MESON)
install
-C
$(BUILD_DIR)
--no-rebuild
--tags
libmediasoup-worker
worker/build.rs
浏览文件 @
b5c8989b
...
...
@@ -85,6 +85,8 @@ fn main() {
.arg
(
"libmediasoup-worker"
)
.env
(
"MEDIASOUP_OUT_DIR"
,
&
mediasoup_out_dir
)
.env
(
"MEDIASOUP_BUILDTYPE"
,
&
build_type
)
// Force forward slashes on Windows too, otherwise Meson thinks path is not absolute 🤷
.env
(
"INSTALL_DIR"
,
&
out_dir
.replace
(
'\\'
,
"/"
))
.spawn
()
.expect
(
"Failed to start"
)
.wait
()
...
...
@@ -94,49 +96,21 @@ fn main() {
panic!
(
"Failed to build libmediasoup-worker"
)
}
#[cfg(not(target_os
=
"windows"
))]
{
let
from
=
format!
(
"{}/{}/build/libmediasoup-worker.a"
,
mediasoup_out_dir
,
build_type
);
let
to
=
format!
(
"{}/libmediasoup-worker.a"
,
out_dir
);
std
::
fs
::
copy
(
&
from
,
&
to
)
.unwrap_or_else
(|
error
|
{
panic!
(
"Failed to copy static library from {} to {}: {}"
,
from
,
to
,
error
)
});
}
#[cfg(target_os
=
"windows"
)]
{
let
dot_a
=
format!
(
"{}/{}/build/libmediasoup-worker.a"
,
mediasoup_out_dir
,
build_type
);
let
from
=
format!
(
"{}/{}/build/mediasoup-worker.lib"
,
mediasoup_out_dir
,
build_type
);
let
to
=
format!
(
"{}/mediasoup-worker.lib"
,
out_dir
);
let
dot_a
=
format!
(
"{}/libmediasoup-worker.a"
,
out_dir
);
let
dot_lib
=
format!
(
"{}/mediasoup-worker.lib"
,
out_dir
);
// Meson builds `libmediasoup-worker.a` on Windows instead of `*.lib` file under MinGW
if
std
::
path
::
Path
::
new
(
&
dot_a
)
.exists
()
{
std
::
fs
::
copy
(
&
dot_a
,
&
from
)
.unwrap_or_else
(|
error
|
{
std
::
fs
::
copy
(
&
dot_a
,
&
dot_lib
)
.unwrap_or_else
(|
error
|
{
panic!
(
"Failed to copy static library from {} to {}: {}"
,
dot_a
,
from
,
error
dot_a
,
dot_lib
,
error
)
});
}
std
::
fs
::
copy
(
&
from
,
&
to
)
.unwrap_or_else
(|
error
|
{
panic!
(
"Failed to copy static library from {} to {}: {}"
,
from
,
to
,
error
)
});
// These are required by libuv on Windows
println!
(
"cargo:rustc-link-lib=psapi"
);
println!
(
"cargo:rustc-link-lib=user32"
);
...
...
worker/meson.build
浏览文件 @
b5c8989b
...
...
@@ -233,6 +233,8 @@ libmediasoup_worker = library(
'libmediasoup-worker',
name_prefix: '',
build_by_default: false,
install: true,
install_tag: 'libmediasoup-worker',
dependencies: dependencies,
sources: common_sources,
include_directories: include_directories('include'),
...
...
@@ -243,6 +245,8 @@ libmediasoup_worker = library(
executable(
'mediasoup-worker',
build_by_default: true,
install: true,
install_tag: 'mediasoup-worker',
dependencies: dependencies,
sources: common_sources + ['src/main.cpp'],
include_directories: include_directories('include'),
...
...
@@ -252,6 +256,8 @@ executable(
mediasoup_worker_test = executable(
'mediasoup-worker-test',
build_by_default: false,
install: true,
install_tag: 'mediasoup-worker-test',
dependencies: dependencies + [
catch2_proj.get_variable('catch2_dep'),
],
...
...
@@ -314,6 +320,8 @@ if host_machine.system() == 'linux'
executable(
'mediasoup-worker-fuzzer',
build_by_default: false,
install: true,
install_tag: 'mediasoup-worker-fuzzer',
dependencies: dependencies,
sources: common_sources + [
'fuzzer/src/fuzzer.cpp',
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论