mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-22 01:21:05 +00:00
7eaf47d7b5
See https://github.com/rust-lang/cargo/issues/5077#issuecomment-1284482987 and https://github.com/rust-lang/rust/issues/127100 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1516>
23 lines
766 B
Rust
23 lines
766 B
Rust
#[cfg(docsrs)]
|
|
fn main() {} // prevent linking libraries to avoid documentation failure
|
|
|
|
// https://github.com/rust-lang/cargo/issues/5077#issuecomment-1284482987
|
|
#[cfg(not(docsrs))]
|
|
fn main() {
|
|
#[cfg(target_os = "macos")]
|
|
match system_deps::Config::new().probe() {
|
|
Ok(deps) => {
|
|
let usr = std::path::Path::new("/usr/lib");
|
|
let usr_local = std::path::Path::new("/usr/local/lib");
|
|
for dep in deps.all_link_paths() {
|
|
if dep != &usr && dep != &usr_local {
|
|
println!("cargo:rustc-link-arg=-Wl,-rpath,{:?}", dep.as_os_str());
|
|
}
|
|
}
|
|
}
|
|
Err(s) => {
|
|
println!("cargo:warning={s}");
|
|
std::process::exit(1);
|
|
}
|
|
}
|
|
}
|