From cde450cd985ec5ab64cbff25f91eb6d9a2780e6b Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Wed, 27 Nov 2024 17:00:01 +0100 Subject: [PATCH] Expose USE_VALGRIND compilation flag as use-valgrind feature --- heed/Cargo.toml | 2 ++ lmdb-master-sys/Cargo.toml | 1 + lmdb-master-sys/build.rs | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/heed/Cargo.toml b/heed/Cargo.toml index f0df6524..5a33ced7 100644 --- a/heed/Cargo.toml +++ b/heed/Cargo.toml @@ -110,6 +110,8 @@ mdb_idl_logn_16 = ["lmdb-master-sys/mdb_idl_logn_16"] # computers then you need to keep your keys within the smaller 1982 byte limit. longer-keys = ["lmdb-master-sys/longer-keys"] +use-valgrind = ["lmdb-master-sys/use-valgrind"] + [[example]] name = "rmp-serde" required-features = ["serde-rmp"] diff --git a/lmdb-master-sys/Cargo.toml b/lmdb-master-sys/Cargo.toml index 7f4c0e71..a6955ade 100644 --- a/lmdb-master-sys/Cargo.toml +++ b/lmdb-master-sys/Cargo.toml @@ -60,6 +60,7 @@ mdb_idl_logn_13 = [] mdb_idl_logn_14 = [] mdb_idl_logn_15 = [] mdb_idl_logn_16 = [] +use-valgrind = [] # Setting this enables you to use keys longer than 511 bytes. The exact limit # is computed by LMDB at compile time. You can find the exact value by calling diff --git a/lmdb-master-sys/build.rs b/lmdb-master-sys/build.rs index 9bff3df5..edfe47e2 100644 --- a/lmdb-master-sys/build.rs +++ b/lmdb-master-sys/build.rs @@ -137,6 +137,10 @@ fn main() { builder.define("MDB_USE_POSIX_SEM", None); } + if cfg!(feature = "use-valgrind") { + builder.define("USE_VALGRIND", None); + } + if cfg!(feature = "asan") { builder.flag("-fsanitize=address"); }