Skip to content

Commit 6807959

Browse files
committed
build: Avoid to add unwanted system folder in library research paths
Default pkg-config-rs behavior is to add default system library paths (ex: -L/usr/lib/x86_64-linux-gnu). This is because PKG_CONFIG_ALLOW_SYSTEM_LIBS is set by pkg-config-rs by default. print_system_libs(false) disable this behavior.
1 parent d078a08 commit 6807959

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

build.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ fn check_func(function_name: &str) -> bool {
3535
}
3636

3737
fn main() {
38-
pkg_config::find_library("libudev").unwrap();
38+
let mut config = pkg_config::Config::new();
39+
config.print_system_libs(false);
40+
config.probe("libudev").unwrap();
3941

4042
if check_func("udev_hwdb_new") {
4143
println!("cargo:rustc-cfg=hwdb");

0 commit comments

Comments
 (0)