Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ default = [
]
jemalloc = ["rust-librocksdb-sys/jemalloc"]
io-uring = ["rust-librocksdb-sys/io-uring"]
io-uring-static = ["rust-librocksdb-sys/io-uring-static"]
numa = ["rust-librocksdb-sys/numa"]
valgrind = []
snappy = ["rust-librocksdb-sys/snappy"]
Expand Down
1 change: 1 addition & 0 deletions librocksdb-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ bindgen-runtime = ["bindgen/runtime"]
bindgen-static = ["bindgen/static"]
mt_static = []
io-uring = ["pkg-config"]
io-uring-static = []
numa = ["pkg-config"]
snappy = []
lz4 = ["lz4-sys"]
Expand Down
14 changes: 10 additions & 4 deletions librocksdb-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,16 +304,22 @@ fn build_rocksdb() {

#[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");
// probe_library() only looks for shared objects, so this is misleading when statically
// linking
if cfg!(not(feature = "io-uring-static")) {
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"));

let mode = if cfg!(feature = "static") {
let mode = if cfg!(feature = "io-uring-static") {
"=static"
} else {
""
};
if cfg!(feature = "static") {

if cfg!(feature = "io-uring-static") {
// centos uses its /usr/lib64 search path but liburing.a is installed
// by dnf oddly in /usr/lib unlike other installed archives.
println!("cargo:rustc-link-search=native=/usr/lib");
Expand Down
Loading