From 88f2097cf0efe0720e581f6a150fc110ae6ec1ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Roff=C3=A9?= Date: Thu, 13 Jan 2022 15:18:10 +0100 Subject: [PATCH] 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. --- build.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build.rs b/build.rs index 20cf4a0..c8233f0 100644 --- a/build.rs +++ b/build.rs @@ -35,7 +35,9 @@ fn check_func(function_name: &str) -> bool { } fn main() { - pkg_config::find_library("libudev").unwrap(); + pkg_config::Config::new() + .print_system_libs(false) + .probe("libudev").unwrap(); if check_func("udev_hwdb_new") { println!("cargo:rustc-cfg=hwdb");