Add feature flag for runtime type information, and metadata for locating library and sources (#544)

master
Johnny Graettinger 3 years ago committed by GitHub
parent 0976f770fa
commit 97ceb8466f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      Cargo.toml
  2. 1
      librocksdb-sys/Cargo.toml
  3. 13
      librocksdb-sys/build.rs

@ -25,6 +25,7 @@ lz4 = ["librocksdb-sys/lz4"]
zstd = ["librocksdb-sys/zstd"] zstd = ["librocksdb-sys/zstd"]
zlib = ["librocksdb-sys/zlib"] zlib = ["librocksdb-sys/zlib"]
bzip2 = ["librocksdb-sys/bzip2"] bzip2 = ["librocksdb-sys/bzip2"]
rtti = ["librocksdb-sys/rtti"]
multi-threaded-cf = [] multi-threaded-cf = []
[dependencies] [dependencies]

@ -20,6 +20,7 @@ lz4 = []
zstd = [] zstd = []
zlib = [] zlib = []
bzip2 = [] bzip2 = []
rtti = []
[dependencies] [dependencies]
libc = "0.2" libc = "0.2"

@ -83,6 +83,10 @@ fn build_rocksdb() {
config.include("bzip2/"); config.include("bzip2/");
} }
if cfg!(feature = "rtti") {
config.define("USE_RTTI", Some("1"));
}
config.include("."); config.include(".");
config.define("NDEBUG", Some("1")); config.define("NDEBUG", Some("1"));
@ -400,4 +404,13 @@ fn main() {
fail_on_empty_directory("bzip2"); fail_on_empty_directory("bzip2");
build_bzip2(); build_bzip2();
} }
// Allow dependent crates to locate the sources and output directory of
// this crate. Notably, this allows a dependent crate to locate the RocksDB
// sources and built archive artifacts provided by this crate.
println!(
"cargo:cargo_manifest_dir={}",
env::var("CARGO_MANIFEST_DIR").unwrap()
);
println!("cargo:out_dir={}", env::var("OUT_DIR").unwrap());
} }

Loading…
Cancel
Save