Add link stdlib when linking prebuilt rocksdb (#443)

master
unrealhoang 4 years ago committed by GitHub
parent 22c4780c59
commit 5a35cb7262
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      librocksdb-sys/build.rs

@ -333,6 +333,14 @@ fn main() {
println!("cargo:rerun-if-changed=rocksdb/");
fail_on_empty_directory("rocksdb");
build_rocksdb();
} else {
let target = env::var("TARGET").unwrap();
// according to https://github.com/alexcrichton/cc-rs/blob/master/src/lib.rs#L2189
if target.contains("apple") || target.contains("freebsd") || target.contains("openbsd") {
println!("cargo:rustc-link-lib=dylib=c++");
} else if target.contains("linux") {
println!("cargo:rustc-link-lib=dylib=stdc++");
}
}
if cfg!(feature = "snappy") && !try_to_find_and_link_lib("SNAPPY") {
println!("cargo:rerun-if-changed=snappy/");

Loading…
Cancel
Save