Skip to content

Commit

Permalink
Add zlib when linking statically
Browse files Browse the repository at this point in the history
  • Loading branch information
cschwan committed Apr 5, 2024
1 parent 708f58d commit 40d962a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pineappl_fastnlo/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ fn main() {
.unwrap();

let link_modifier = if cfg!(feature = "static") {
let zlib = Config::new().probe("zlib").unwrap();

// for some reason `libz.a` isn't found, although `libz.so` is
for link_path in zlib.link_paths {
println!("cargo:rustc-link-search={}", link_path.to_str().unwrap());
}

for lib in zlib.libs {
println!("cargo:rustc-link-lib=static={lib}");
}

"static="
} else {
""
Expand Down

0 comments on commit 40d962a

Please sign in to comment.