Skip to content

Commit 6a4fe85

Browse files
committed
Rewrite the build.rs to be more Rust idiomatic wrt features
1 parent 4ee8a16 commit 6a4fe85

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lmdb-master3-sys/build.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ fn main() {
4242
.flag_if_supported("-Wbad-function-cast")
4343
.flag_if_supported("-Wuninitialized");
4444

45-
if env::var("CARGO_FEATURE_WITH_ASAN").is_ok() {
45+
if cfg!(feature = "with-asan") {
4646
builder.flag("-fsanitize=address");
4747
}
4848

49-
if env::var("CARGO_FEATURE_WITH_FUZZER").is_ok() {
49+
if cfg!(feature = "with-fuzzer") {
5050
builder.flag("-fsanitize=fuzzer");
51-
} else if env::var("CARGO_FEATURE_WITH_FUZZER_NO_LINK").is_ok() {
51+
} else if cfg!(feature = "with-fuzzer-no-link") {
5252
builder.flag("-fsanitize=fuzzer-no-link");
5353
}
5454

0 commit comments

Comments
 (0)