Skip to content

Commit

Permalink
Propagate OPENSSL_DIR on vendored builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSidhion committed Dec 9, 2023
1 parent a3d3449 commit c9524ef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion openssl-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ bssl-sys = { version = "0.1.0", optional = true }
[build-dependencies]
bindgen = { version = "0.65.0", optional = true, features = ["experimental"] }
cc = "1.0.61"
openssl-src = { version = "300.1.2", optional = true, features = ["legacy"] }
openssl-src = { version = "300.2.0", optional = true, features = ["legacy"] }
pkg-config = "0.3.9"
vcpkg = "0.2.8"

Expand Down
11 changes: 10 additions & 1 deletion openssl-sys/build/find_vendored.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
use openssl_src;
use std::path::PathBuf;

use super::env;

pub fn get_openssl(_target: &str) -> (Vec<PathBuf>, PathBuf) {
let artifacts = openssl_src::Build::new().build();
let openssl_dir = env("OPENSSL_DIR");

let mut openssl_src_build = openssl_src::Build::new();
if let Some(value) = openssl_dir {
openssl_src_build.openssl_dir(PathBuf::from(value));
}

let artifacts = openssl_src_build.build();
println!("cargo:vendored=1");
println!(
"cargo:root={}",
Expand Down

0 comments on commit c9524ef

Please sign in to comment.