Skip to content

Commit

Permalink
don't pass CFLAGS to underlying compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
Konrad Stepniak committed Jan 31, 2025
1 parent 876bc11 commit 52accb4
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions jemalloc-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,10 @@ fn main() {
println!("cargo:rustc-link-lib={}={}", kind, &stem[3..]);
return;
}
// Disable -Wextra warnings - jemalloc doesn't compile free of warnings with
// it enabled: https://github.com/jemalloc/jemalloc/issues/1196
let compiler = cc::Build::new().extra_warnings(false).get_compiler();
let cflags = compiler
.args()
.iter()
.map(|s| s.to_str().unwrap())
.collect::<Vec<_>>()
.join(" ");
info!("CC={:?}", compiler.path());
info!("CFLAGS={:?}", cflags);

let compiler = cc::Build::new().get_compiler();
info!("CC={:?}", compiler.path());

assert!(out_dir.exists(), "OUT_DIR does not exist");
let jemalloc_repo_dir = PathBuf::from("jemalloc");
info!("JEMALLOC_REPO_DIR={:?}", jemalloc_repo_dir);
Expand Down Expand Up @@ -190,9 +182,6 @@ fn main() {
)
.current_dir(&build_dir)
.env("CC", compiler.path())
.env("CFLAGS", cflags.clone())
.env("LDFLAGS", cflags.clone())
.env("CPPFLAGS", cflags)
.arg(format!("--with-version={je_version}"))
.arg("--disable-cxx")
.arg("--enable-doc=no")
Expand Down

0 comments on commit 52accb4

Please sign in to comment.