Skip to content

Instantly share code, notes, and snippets.

@a1ien
Created December 24, 2019 09:58
Show Gist options
  • Save a1ien/d94caafa888a8707015558a696162783 to your computer and use it in GitHub Desktop.
Save a1ien/d94caafa888a8707015558a696162783 to your computer and use it in GitHub Desktop.
libusb use libudev pkgconfig
match pkg_config::probe_library("libudev") {
Ok(lib) => {
for lib_dir in &lib.link_paths {
println!("cargo:lib={}", lib_dir.to_str().unwrap());
}
for include_dir in &lib.include_paths {
println!("cargo:include={}", include_dir.to_str().unwrap());
}
base_config.define("USE_UDEV", Some("1"));
base_config.define("HAVE_LIBUDEV", Some("1"));
base_config.define("HAVE_LIBUDEV_H", Some("1"));
}
_=>{}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment