diff --git a/libyang3-sys/build.rs b/libyang3-sys/build.rs index dc54c89..62a3a9d 100644 --- a/libyang3-sys/build.rs +++ b/libyang3-sys/build.rs @@ -12,6 +12,9 @@ fn main() { if let Ok(lib) = pkg_config::Config::new().probe("libpcre2-8") { include_paths = lib.include_paths.clone(); } + if let Ok(lib) = pkg_config::Config::new().probe("libxxhash") { + include_paths.extend(lib.include_paths.clone()); + } // Add libyang include paths if found in pkg-config if let Ok(lib) = pkg_config::Config::new().probe("libyang") { include_paths.extend(lib.include_paths.clone()); @@ -74,6 +77,12 @@ fn main() { println!("cargo:warning=attempting to link without pkg-config"); println!("cargo:rustc-link-lib=pcre2-8"); } + if let Err(e) = pkg_config::Config::new().probe("libxxhash") { + println!("cargo:warning=failed to find xxhash library with pkg-config: {}", e); + println!( + "cargo:warning=attempting to link xxhash without pkg-config" + ); + } println!("cargo:rustc-link-lib=static=yang"); println!("cargo:rerun-if-changed=libyang"); }