From 85c30e8eebda72107e70cf177312ddf843d6b78e Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Thu, 8 Aug 2024 10:46:21 +0100 Subject: [PATCH] Add aliases for complex feature flag combinations (#4479) --- core/build.rs | 16 ++++++++++++++++ lib/build.rs | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 core/build.rs create mode 100644 lib/build.rs diff --git a/core/build.rs b/core/build.rs new file mode 100644 index 00000000..dd361085 --- /dev/null +++ b/core/build.rs @@ -0,0 +1,16 @@ +fn main() { + if cfg!(target_arch = "wasm32") { + println!("cargo:rustc-cfg=wasm"); + println!("cargo::rustc-check-cfg=cfg(wasm)"); + } + if cfg!(any( + feature = "kv-mem", + feature = "kv-fdb", + feature = "kv-tikv", + feature = "kv-rocksdb", + feature = "kv-surrealkv", + )) { + println!("cargo:rustc-cfg=storage"); + println!("cargo::rustc-check-cfg=cfg(storage)"); + } +} diff --git a/lib/build.rs b/lib/build.rs new file mode 100644 index 00000000..dd361085 --- /dev/null +++ b/lib/build.rs @@ -0,0 +1,16 @@ +fn main() { + if cfg!(target_arch = "wasm32") { + println!("cargo:rustc-cfg=wasm"); + println!("cargo::rustc-check-cfg=cfg(wasm)"); + } + if cfg!(any( + feature = "kv-mem", + feature = "kv-fdb", + feature = "kv-tikv", + feature = "kv-rocksdb", + feature = "kv-surrealkv", + )) { + println!("cargo:rustc-cfg=storage"); + println!("cargo::rustc-check-cfg=cfg(storage)"); + } +}