Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions webrtc-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@ cxx-build = "1.0"
glob = "0.3"
cc = "1.0"

[target.'cfg(target_os = "linux")'.build-dependencies]
pkg-config = "0.3.22"

[dev-dependencies]
env_logger = "0.10"
20 changes: 14 additions & 6 deletions webrtc-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,21 @@ fn main() {
println!("cargo:rustc-link-lib=dylib=pthread");
println!("cargo:rustc-link-lib=dylib=m");

println!("cargo:rustc-link-lib=dylib=glib-2.0");
println!("cargo:rustc-link-lib=dylib=gobject-2.0");
println!("cargo:rustc-link-lib=dylib=gio-2.0");
println!("cargo:rustc-link-lib=dylib=drm");
println!("cargo:rustc-link-lib=dylib=gbm");
if std::env::var("LK_CUSTOM_WEBRTC").is_ok() {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With livekit#730, this is a proxy for whether the Debian sysroot was used to build libwebrtc.

for lib_name in ["glib-2.0", "gobject-2.0", "gio-2.0"] {
let lib = pkg_config::probe_library(lib_name).unwrap();
builder.includes(lib.include_paths);
}
} else {
println!("cargo:rustc-link-lib=dylib=glib-2.0");
println!("cargo:rustc-link-lib=dylib=gobject-2.0");
println!("cargo:rustc-link-lib=dylib=gio-2.0");
add_gio_headers(&mut builder);
}

add_gio_headers(&mut builder);
for lib_name in ["libdrm", "gbm"] {
pkg_config::probe_library(lib_name).unwrap();
}

match target_arch.as_str() {
"x86_64" => {
Expand Down