diff options
Diffstat (limited to 'openssl')
| -rw-r--r-- | openssl/build.rs | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/openssl/build.rs b/openssl/build.rs index cd1dc3ec..41847b0f 100644 --- a/openssl/build.rs +++ b/openssl/build.rs @@ -1,18 +1,19 @@ use std::env; fn main() { - if env::var("DEP_OPENSSL_IS_110").is_ok() { - println!("cargo:rustc-cfg=ossl110"); - return; - } else if env::var("DEP_OPENSSL_IS_102").is_ok() { - println!("cargo:rustc-cfg=ossl102"); - println!("cargo:rustc-cfg=ossl10x"); - return; - } else if env::var("DEP_OPENSSL_IS_101").is_ok() { - println!("cargo:rustc-cfg=ossl101"); - println!("cargo:rustc-cfg=ossl10x"); - } else { - panic!("Unable to detect OpenSSL version"); + match env::var("DEP_OPENSSL_VERSION") { + Ok(ref v) if v == "101" => { + println!("cargo:rustc-cfg=ossl101"); + println!("cargo:rustc-cfg=ossl10x"); + } + Ok(ref v) if v == "102" => { + println!("cargo:rustc-cfg=ossl102"); + println!("cargo:rustc-cfg=ossl10x"); + } + Ok(ref v) if v == "110" => { + println!("cargo:rustc-cfg=ossl110"); + } + _ => panic!("Unable to detect OpenSSL version"), } if let Ok(vars) = env::var("DEP_OPENSSL_OSSLCONF") { |