Skip to content

Commit

Permalink
Fix build on x86_64
Browse files Browse the repository at this point in the history
On same platform, library file is compiled into `lib64` directory. Rust compiler expects that library will be in `lib` directory. This fixes this by searing library both in `lib` and `lib64` directory.
  • Loading branch information
JakubOnderka authored Jul 24, 2023
1 parent 4457ab3 commit f8be294
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions build_zng.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,15 @@ pub fn build_zlib_ng(target: &str, compat: bool) {

let includedir = install_dir.join("include");
let libdir = install_dir.join("lib");
let libdir64 = install_dir.join("lib64");
println!(
"cargo:rustc-link-search=native={}",
libdir.to_str().unwrap()
);
println!(
"cargo:rustc-link-search=native={}",
libdir64.to_str().unwrap()
);
let mut debug_suffix = "";
let libname = if target.contains("windows") && target.contains("msvc") {
if env::var("OPT_LEVEL").unwrap() == "0" {
Expand Down

0 comments on commit f8be294

Please sign in to comment.