Add support for building with io_uring on Linux. (#621)

master
parazyd 2 years ago committed by GitHub
parent 8710105cb5
commit 03f10c0d2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      Cargo.toml
  2. 2
      librocksdb-sys/Cargo.toml
  3. 7
      librocksdb-sys/build.rs

@ -22,6 +22,7 @@ members = ["librocksdb-sys"]
[features] [features]
default = ["snappy", "lz4", "zstd", "zlib", "bzip2"] default = ["snappy", "lz4", "zstd", "zlib", "bzip2"]
jemalloc = ["librocksdb-sys/jemalloc"] jemalloc = ["librocksdb-sys/jemalloc"]
io-uring = ["librocksdb-sys/io-uring"]
valgrind = [] valgrind = []
snappy = ["librocksdb-sys/snappy"] snappy = ["librocksdb-sys/snappy"]
lz4 = ["librocksdb-sys/lz4"] lz4 = ["librocksdb-sys/lz4"]

@ -15,6 +15,7 @@ links = "rocksdb"
default = [ "static" ] default = [ "static" ]
jemalloc = ["tikv-jemalloc-sys"] jemalloc = ["tikv-jemalloc-sys"]
static = ["libz-sys?/static", "bzip2-sys?/static"] static = ["libz-sys?/static", "bzip2-sys?/static"]
io-uring = ["pkg-config"]
snappy = [] snappy = []
lz4 = [] lz4 = []
zstd = ["zstd-sys"] zstd = ["zstd-sys"]
@ -37,3 +38,4 @@ uuid = { version = "1.0", features = ["v4"] }
cc = { version = "1.0", features = ["parallel"] } cc = { version = "1.0", features = ["parallel"] }
bindgen = { version = "0.60", default-features = false, features = ["runtime"] } bindgen = { version = "0.60", default-features = false, features = ["runtime"] }
glob = "0.3" glob = "0.3"
pkg-config = { version = "0.3", optional = true }

@ -220,6 +220,13 @@ fn build_rocksdb() {
config.define("WITH_JEMALLOC", "ON"); config.define("WITH_JEMALLOC", "ON");
} }
#[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"));
}
if target.contains("msvc") { if target.contains("msvc") {
config.flag("-EHsc"); config.flag("-EHsc");
config.flag("-std:c++17"); config.flag("-std:c++17");

Loading…
Cancel
Save