diff --git a/livekit-ffi/build.rs b/livekit-ffi/build.rs index 75432fdb..33a18d77 100644 --- a/livekit-ffi/build.rs +++ b/livekit-ffi/build.rs @@ -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");