Skip to content

Commit

Permalink
Update OpenSSL initialization check (#419)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton authored Nov 2, 2021
1 parent 142ee96 commit 10db235
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
use std::env;
use std::str::FromStr;

fn main() {
// OpenSSL >= 1.1.0 can be initialized concurrently and is initialized correctly by libcurl.
// <= 1.0.2 need locking callbacks, which are provided by openssl_sys::init().
let use_openssl = match env::var("DEP_OPENSSL_VERSION") {
Ok(ver) => {
let ver = u32::from_str(&ver).unwrap();
if ver < 110 {
let use_openssl = match env::var("DEP_OPENSSL_VERSION_NUMBER") {
Ok(version) => {
let version = u64::from_str_radix(&version, 16).unwrap();
if version < 0x1_01_00_00_0 {
println!("cargo:rustc-cfg=need_openssl_init");
}
true
Expand Down

0 comments on commit 10db235

Please sign in to comment.