Skip to content

Commit

Permalink
Disable debug info when compiling smoke test to detect system zlib
Browse files Browse the repository at this point in the history
When compiling for Apple platforms, with the output set to /dev/null,
the test fails because clang invokes dsymutil on the output, and that
fails on /dev/null.

clang doesn't invoke dsymutil if compiling without debug info.
  • Loading branch information
glandium committed Jan 29, 2024
1 parent c61c47f commit 30af79e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,11 @@ fn try_vcpkg() -> bool {

fn zlib_installed(cfg: &mut cc::Build) -> bool {
let mut cmd = cfg.get_compiler().to_command();
cmd.arg("src/smoke.c").arg("-o").arg("/dev/null").arg("-lz");
cmd.arg("src/smoke.c")
.arg("-o")
.arg("-g0")
.arg("/dev/null")
.arg("-lz");

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

0 comments on commit 30af79e

Please sign in to comment.