Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions livekit-ffi/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,26 @@ fn main() {
webrtc_sys_build::download_webrtc().unwrap();
}

{
// Copy the webrtc license to CARGO_MANIFEST_DIR
// (used by the ffi release action)
let webrtc_dir = webrtc_sys_build::webrtc_dir();
let license = webrtc_dir.join("LICENSE.md");
let target_dir = env::var("CARGO_MANIFEST_DIR").unwrap();

let out_file = Path::new(&target_dir).join("WEBRTC_LICENSE.md");

std::fs::copy(license, out_file).unwrap();
}

let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap();
match target_os.as_str() {
"windows" => {}
"linux" => {
// Link webrtc library
println!("cargo:rustc-link-lib=static=webrtc");
}
"android" => {
webrtc_sys_build::configure_jni_symbols().unwrap();
// Copy the webrtc license to CARGO_MANIFEST_DIR
// (used by the ffi release action)
let license = webrtc_dir.join("LICENSE.md");
let target_dir = env::var("CARGO_MANIFEST_DIR").unwrap();

let out_file = Path::new(&target_dir).join("WEBRTC_LICENSE.md");

std::fs::copy(license, out_file).unwrap();
}
"macos" | "ios" => {
println!("cargo:rustc-link-arg=-ObjC");
Expand Down