Add aliases for complex feature flag combinations (#4479)

This commit is contained in:
Tobie Morgan Hitchcock 2024-08-08 10:46:21 +01:00 committed by GitHub
parent e13c277f9d
commit 85c30e8eeb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 32 additions and 0 deletions

16
core/build.rs Normal file
View file

@ -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)");
}
}

16
lib/build.rs Normal file
View file

@ -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)");
}
}