Skip to content

Commit 82b4a80

Browse files
authored
Merge pull request #181 from glandium/apple
Really try dylib when compiling for Apple platforms
2 parents a7d8a82 + 2135741 commit 82b4a80

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

build.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,10 @@ fn main() {
6767
// Apple platforms have libz.1.dylib, and it's usually available even when
6868
// cross compiling (via fat binary or in the target's Xcode SDK)
6969
let cross_compiling = target != host;
70-
let apple_to_apple = host.contains("-apple-") && target.contains("-apple-");
7170
if target.contains("msvc")
7271
|| target.contains("pc-windows-gnu")
7372
|| want_static
74-
|| (cross_compiling && !apple_to_apple)
73+
|| (cross_compiling && !target.contains("-apple-"))
7574
{
7675
return build_zlib(&mut cfg, &target);
7776
}
@@ -185,7 +184,11 @@ fn try_vcpkg() -> bool {
185184

186185
fn zlib_installed(cfg: &mut cc::Build) -> bool {
187186
let mut cmd = cfg.get_compiler().to_command();
188-
cmd.arg("src/smoke.c").arg("-o").arg("/dev/null").arg("-lz");
187+
cmd.arg("src/smoke.c")
188+
.arg("-g0")
189+
.arg("-o")
190+
.arg("/dev/null")
191+
.arg("-lz");
189192

190193
println!("running {:?}", cmd);
191194
if let Ok(status) = cmd.status() {

0 commit comments

Comments
 (0)