Skip to content

Commit

Permalink
build.rs: Fix library name on Windows, with and without MSVC
Browse files Browse the repository at this point in the history
Current zlib-ng uses "zlibstatic" for the static library on MSVC Windows
only, and uses just "z" for non-MSVC Windows targets.
  • Loading branch information
joshtriplett committed Mar 7, 2022
1 parent fd4d356 commit 072ba73
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,11 @@ fn build_zlib_ng(target: &str) {
"cargo:rustc-link-search=native={}",
libdir.to_str().unwrap()
);
let libname = if target.contains("windows") {
if target.contains("msvc") && env::var("OPT_LEVEL").unwrap() == "0" {
"zlibd"
let libname = if target.contains("windows") && target.contains("msvc") {
if env::var("OPT_LEVEL").unwrap() == "0" {
"zlibstaticd"
} else {
"zlib"
"zlibstatic"
}
} else {
"z"
Expand Down

0 comments on commit 072ba73

Please sign in to comment.