mirror of
https://github.com/urbit/ares.git
synced 2024-11-26 09:57:56 +03:00
pma: add crate feature to control debugging printfs
This commit is contained in:
parent
3acf8e74c1
commit
dd814b3e1f
@ -12,6 +12,8 @@ edition = "2018"
|
||||
# Please keep these alphabetized
|
||||
[dependencies]
|
||||
ares_macros = { path = "../ares_macros" }
|
||||
# Use this when debugging requires the debug printfs in the PMA
|
||||
# ares_pma = { path = "../ares_pma", features=["debug_prints"] }
|
||||
ares_pma = { path = "../ares_pma" }
|
||||
assert_no_alloc = "1.1.2"
|
||||
# use this when debugging requires allocation (e.g. eprintln)
|
||||
|
@ -11,3 +11,5 @@ edition = "2018"
|
||||
bindgen = "0.69.1"
|
||||
cc = "1.0"
|
||||
|
||||
[features]
|
||||
debug_prints = []
|
||||
|
@ -8,7 +8,7 @@ use bindgen::CargoCallbacks;
|
||||
fn main() {
|
||||
let profile = env::var("PROFILE").unwrap();
|
||||
let opt_level = env::var("OPT_LEVEL").unwrap();
|
||||
let define_debug = if profile == "debug" {
|
||||
let define_debug = if env::var("CARGO_FEATURE_DEBUG_PRINTS").is_ok() {
|
||||
"-DDEBUG"
|
||||
} else {
|
||||
"-UDEBUG"
|
||||
|
Loading…
Reference in New Issue
Block a user