Skip to content

Commit 3c85a37

Browse files
committed
Link xxhash with pkg-config
1 parent 6385d1d commit 3c85a37

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

libyang3-sys/build.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ fn main() {
1212
if let Ok(lib) = pkg_config::Config::new().probe("libpcre2-8") {
1313
include_paths = lib.include_paths.clone();
1414
}
15+
if let Ok(lib) = pkg_config::Config::new().probe("libxxhash") {
16+
include_paths.extend(lib.include_paths.clone());
17+
}
1518
// Add libyang include paths if found in pkg-config
1619
if let Ok(lib) = pkg_config::Config::new().probe("libyang") {
1720
include_paths.extend(lib.include_paths.clone());
@@ -74,6 +77,10 @@ fn main() {
7477
println!("cargo:warning=attempting to link without pkg-config");
7578
println!("cargo:rustc-link-lib=pcre2-8");
7679
}
80+
if let Err(e) = pkg_config::Config::new().probe("libxxhash") {
81+
println!("cargo:warning=failed to find xxhash library with pkg-config: {}", e);
82+
println!("cargo:warning=attempting to link xxhash without pkg-config");
83+
}
7784
println!("cargo:rustc-link-lib=static=yang");
7885
println!("cargo:rerun-if-changed=libyang");
7986
}

0 commit comments

Comments
 (0)