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
6 changes: 1 addition & 5 deletions dimos/hardware/sensors/camera/realsense/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion dimos/hardware/sensors/camera/realsense/rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@

// realsense-sys only emits -L for librealsense2; bake its directory in as an
// rpath so the binary runs outside the nix shell that built it. nixpkgs' .pc
// names lib/x86_64-linux-gnu while the .so sits in lib/, so walk up to it.
// names lib/x86_64-linux-gnu while the .so sits in lib/, so walk up to it --
// for the linker too, or `-lrealsense2` is not found at all.
fn main() {
let lib = pkg_config::probe_library("realsense2").expect("librealsense2 via pkg-config");
for path in lib.link_paths {
let dir = path
.ancestors()
.find(|d| d.join("librealsense2.so").exists())
.unwrap_or(&path);
println!("cargo:rustc-link-search=native={}", dir.display());
println!("cargo:rustc-link-arg=-Wl,-rpath,{}", dir.display());
}
}
Loading