Skip to content

Commit 2f6b2f6

Browse files
committed
Add debug_in_debug feature
This new feature is similar to the `debug` feature with the slight change that it is enabled automatically for debug configurations.
1 parent 697f23f commit 2f6b2f6

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ default = ["secure"]
2828
secure = ["libmimalloc-sys/secure"]
2929
override = ["libmimalloc-sys/override"]
3030
debug = ["libmimalloc-sys/debug"]
31+
debug_in_debug = ["libmimalloc-sys/debug_in_debug"]
3132
local_dynamic_tls = ["libmimalloc-sys/local_dynamic_tls"]

libmimalloc-sys/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ cc = "1.0"
1919
[features]
2020
secure = []
2121
debug = []
22+
debug_in_debug = []
2223
override = []
2324
extended = ["cty"]
2425
local_dynamic_tls = []

libmimalloc-sys/build.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ fn main() {
3232
}
3333
}
3434

35-
if env::var_os("CARGO_FEATURE_DEBUG").is_some() {
35+
if env::var_os("CARGO_FEATURE_DEBUG").is_some()
36+
|| (env::var_os("CARGO_FEATURE_DEBUG_IN_DEBUG").is_some() && cfg!(debug_assertions))
37+
{
3638
build.define("MI_DEBUG", "3");
3739
build.define("MI_SHOW_ERRORS", "1");
3840
} else {

0 commit comments

Comments
 (0)