From 6e39fb78b953f4d38b510865d9af8678155c2a55 Mon Sep 17 00:00:00 2001 From: Ziyang Hu Date: Fri, 14 Oct 2022 12:24:18 +0800 Subject: [PATCH] set features --- Cargo.lock | 1 + Cargo.toml | 6 +++++- cozorocks/Cargo.toml | 6 +++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 390175ab..7182135a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -871,6 +871,7 @@ dependencies = [ "glob", "libc", "libz-sys", + "pkg-config", "tikv-jemalloc-sys", "zstd-sys", ] diff --git a/Cargo.toml b/Cargo.toml index 2b4ab25e..83216f9a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,10 @@ license = "AGPL-3.0-or-later" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[features] +jemalloc = ["tikv-jemallocator-global", "cozorocks/jemalloc"] +io-uring = ["cozorocks/io-uring"] + [dependencies] casey = "0.3.3" either = "1.7.0" @@ -43,7 +47,7 @@ unicode-normalization = "0.1.21" thiserror = "1.0.34" uuid = { version = "1.1.2", features = ["v1", "v4", "serde"] } csv = "1.1.6" -tikv-jemallocator-global = "0.5.0" +tikv-jemallocator-global = { version = "0.5.0", optional = true } cozorocks = { path = "cozorocks" } clap = { version = "3.2.8", features = ["derive"] } diff --git a/cozorocks/Cargo.toml b/cozorocks/Cargo.toml index b0113f75..11345ef1 100644 --- a/cozorocks/Cargo.toml +++ b/cozorocks/Cargo.toml @@ -9,7 +9,11 @@ license = "AGPL-3.0-or-later" [dependencies] cxx = "1.0.69" miette = "5.3.0" -librocksdb-sys = { version = "=0.8.0", features = ["static", "jemalloc", "lz4", "zstd", "rtti"] } +librocksdb-sys = { version = "=0.8.0", features = ["lz4", "zstd"] } + +[features] +jemalloc = ["librocksdb-sys/jemalloc"] +io-uring = ["librocksdb-sys/io-uring"] [build-dependencies] cxx-build = "1.0.69" \ No newline at end of file