Skip to content

Commit

Permalink
Pass explicit --enable or --disable to the jemalloc configure.ac to a…
Browse files Browse the repository at this point in the history
…void depending on jemalloc defaults (which could change)

Resolves gnzlbg#160
  • Loading branch information
rocallahan committed Sep 30, 2020
1 parent 78a79e4 commit 5c990e3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions jemalloc-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,24 +303,34 @@ fn main() {

cmd.arg("--with-private-namespace=_rjem_");

// Always pass explicit --enable or --disable so changes in jemalloc
// defaults don't break us.
if env::var("CARGO_FEATURE_DEBUG").is_ok() {
info!("CARGO_FEATURE_DEBUG set");
cmd.arg("--enable-debug");
} else {
cmd.arg("--disable-debug");
}

if env::var("CARGO_FEATURE_PROFILING").is_ok() {
info!("CARGO_FEATURE_PROFILING set");
cmd.arg("--enable-prof");
} else {
cmd.arg("--disable-prof");
}

if env::var("CARGO_FEATURE_STATS").is_ok() {
info!("CARGO_FEATURE_STATS set");
cmd.arg("--enable-stats");
} else {
cmd.arg("--disable-stats");
}

if env::var("CARGO_FEATURE_DISABLE_INITIAL_EXEC_TLS").is_ok() {
info!("CARGO_FEATURE_DISABLE_INITIAL_EXEC_TLS set");
cmd.arg("--disable-initial-exec-tls");
} else {
cmd.arg("--enable-initial-exec-tls");
}

cmd.arg(format!("--host={}", gnu_target(&target)));
Expand Down

0 comments on commit 5c990e3

Please sign in to comment.