diff options
| author | Steven Fackler <[email protected]> | 2016-11-04 21:08:34 -0700 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2016-11-04 21:08:34 -0700 |
| commit | 9198bcda3a7baf2877cb97db260f9f2147b994a6 (patch) | |
| tree | 50a7d647a34d35ebaa2786f2ebe8f50d5daef057 /openssl | |
| parent | Merge pull request #512 from sfackler/no-ref (diff) | |
| download | rust-openssl-9198bcda3a7baf2877cb97db260f9f2147b994a6.tar.xz rust-openssl-9198bcda3a7baf2877cb97db260f9f2147b994a6.zip | |
Improve buildscript logic
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") { |