improve build script

main
Ziyang Hu 2 years ago
parent 7720a4210f
commit 06a9ca6931

@ -13,7 +13,7 @@ librocksdb-sys = { version = "=0.8.0", features = ["lz4", "zstd"] }
[features]
jemalloc = ["librocksdb-sys/jemalloc"]
io-uring = ["librocksdb-sys/io-uring"]
io-uring = ["librocksdb-sys/io-uring", "pkg-config"]
[build-dependencies]
cxx-build = "1.0.69"

@ -24,6 +24,14 @@ fn main() {
builder.flag("-Wno-strict-aliasing");
builder.flag("-Wno-invalid-offsetof");
};
#[cfg(feature = "io-uring")]
if target.contains("linux") {
pkg_config::probe_library("liburing")
.expect("The io-uring feature was requested but the library is not available");
config.define("ROCKSDB_IOURING_PRESENT", Some("1"));
}
builder.compile("cozorocks");
println!("cargo:rustc-link-lib=static=rocksdb");
println!("cargo:rustc-link-lib=static=zstd");

Loading…
Cancel
Save