From 7acbf4389bc0f910dbabf8fef1cca8dad052d203 Mon Sep 17 00:00:00 2001 From: Niko PLP Date: Mon, 14 Aug 2023 00:00:32 +0300 Subject: [PATCH] openbsd and openssl... --- librocksdb-sys/build.rs | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/librocksdb-sys/build.rs b/librocksdb-sys/build.rs index 1dc1759..2223653 100644 --- a/librocksdb-sys/build.rs +++ b/librocksdb-sys/build.rs @@ -145,7 +145,19 @@ fn build_rocksdb() { // the flag has been moved to the darwin. openbsd, freebsd and linux cases below } - if !target.contains("darwin") && !target.contains("linux") { + if target.contains("darwin") || target.contains("linux") { + // on macos and linux we use the IPPCP plugin of rocksdb for the crypto (the lib is precompiled) + config.include("rocksdb/plugin/ippcp/library/include"); + lib_sources.push("plugin/ippcp/ippcp_provider.cc"); + let dir = env::var("CARGO_MANIFEST_DIR").unwrap(); + println!( + "cargo:rustc-link-search=native={}", + Path::new(&dir) + .join("rocksdb/plugin/ippcp/library/macos/lib") + .display() + ); + println!("cargo:rustc-link-lib=static=ippcp"); + } else if !target.contains("openbsd") { if let Some(include) = std::env::var_os("DEP_OPENSSL_INCLUDE") { config.include(include); } else { @@ -161,17 +173,6 @@ fn build_rocksdb() { // ); // println!("cargo:rustc-link-lib=static=crypto"); } else { - // on macos and linux we use the IPPCP plugin of rocksdb for the crypto (the lib is precompiled) - config.include("rocksdb/plugin/ippcp/library/include"); - lib_sources.push("plugin/ippcp/ippcp_provider.cc"); - let dir = env::var("CARGO_MANIFEST_DIR").unwrap(); - println!( - "cargo:rustc-link-search=native={}", - Path::new(&dir) - .join("rocksdb/plugin/ippcp/library/macos/lib") - .display() - ); - println!("cargo:rustc-link-lib=static=ippcp"); } if target.contains("apple-ios") {