提交 6742f961 authored 作者: Nazar Mokrynskyi's avatar Nazar Mokrynskyi

Build debug version of worker if Rust build is debug as well

上级 39913280
...@@ -7,6 +7,12 @@ fn main() { ...@@ -7,6 +7,12 @@ fn main() {
return; return;
} }
let build_type = if cfg!(debug_assertions) {
"Debug"
} else {
"Release"
};
let current_dir = std::env::current_dir() let current_dir = std::env::current_dir()
.unwrap() .unwrap()
.into_os_string() .into_os_string()
...@@ -84,6 +90,7 @@ fn main() { ...@@ -84,6 +90,7 @@ fn main() {
// Build // Build
if !Command::new("make") if !Command::new("make")
.arg("libmediasoup-worker") .arg("libmediasoup-worker")
.env("MEDIASOUP_BUILDTYPE", &build_type)
.env("PYTHONDONTWRITEBYTECODE", "1") .env("PYTHONDONTWRITEBYTECODE", "1")
.spawn() .spawn()
.expect("Failed to start") .expect("Failed to start")
...@@ -106,13 +113,13 @@ fn main() { ...@@ -106,13 +113,13 @@ fn main() {
"libgetopt.a", "libgetopt.a",
] { ] {
std::fs::copy( std::fs::copy(
format!("{}/out/Release/{}", current_dir, file), format!("{}/out/{}/{}", current_dir, build_type, file),
format!("{}/{}", out_dir, file), format!("{}/{}", out_dir, file),
) )
.unwrap_or_else(|_| { .unwrap_or_else(|_| {
panic!( panic!(
"Failed to copy static library from {}/out/Release/{} to {}/{}", "Failed to copy static library from {}/out/{}/{} to {}/{}",
current_dir, file, out_dir, file current_dir, build_type, file, out_dir, file
) )
}); });
} }
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论