Skip to content

Commit

Permalink
Update build.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
theomonnom committed Dec 12, 2024
1 parent 43933e5 commit 43e9e3b
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions livekit-ffi/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,24 @@ 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");
}
"linux" => {}
"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

0 comments on commit 43e9e3b

Please sign in to comment.