Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions libyang3-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the warning, will the build script work ok if xxhash is not found? I see it is an optional libyang dependency, so I would prefer not to make it a mandatory dependency here.

println!(
"cargo:warning=attempting to link xxhash without pkg-config"
);
}
println!("cargo:rustc-link-lib=static=yang");
println!("cargo:rerun-if-changed=libyang");
}
Expand Down
Loading