rustc_back: Fix disabling jemalloc

When building with Cargo we need to detect `feature = "jemalloc"` to enable
jemalloc, so propagate this same change to the build system to pass the right
`--cfg` argument.
This commit is contained in:
Alex Crichton 2016-01-21 18:37:46 -08:00
parent bb2e92171f
commit 55dd595c08
2 changed files with 4 additions and 5 deletions

View File

@ -144,8 +144,7 @@ TARGET_CRATES += alloc_jemalloc
DEPS_std += alloc_jemalloc
DEPS_alloc_jemalloc := core libc native:jemalloc
ONLY_RLIB_alloc_jemalloc := 1
else
RUSTFLAGS_rustc_back := --cfg disable_jemalloc
RUSTFLAGS_rustc_back := --cfg 'feature="jemalloc"'
endif
################################################################################

View File

@ -501,9 +501,9 @@ impl Target {
}
fn maybe_jemalloc() -> String {
if cfg!(disable_jemalloc) {
"alloc_system".to_string()
} else {
if cfg!(feature = "jemalloc") {
"alloc_jemalloc".to_string()
} else {
"alloc_system".to_string()
}
}