Improve buildscript logic
This commit is contained in:
parent
1108db74ec
commit
9198bcda3a
|
|
@ -219,13 +219,13 @@ fn validate_headers(include_dirs: &[PathBuf],
|
|||
};
|
||||
if version_text.contains("0x10001") {
|
||||
println!("cargo:rustc-cfg=ossl101");
|
||||
println!("cargo:is_101=1");
|
||||
println!("cargo:version=101");
|
||||
} else if version_text.contains("0x10002") {
|
||||
println!("cargo:rustc-cfg=ossl102");
|
||||
println!("cargo:is_102=1");
|
||||
println!("cargo:version=102");
|
||||
} else if version_text.contains("0x10100") {
|
||||
println!("cargo:rustc-cfg=ossl110");
|
||||
println!("cargo:is_110=1");
|
||||
println!("cargo:version=110");
|
||||
} else {
|
||||
panic!("
|
||||
|
||||
|
|
|
|||
|
|
@ -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") {
|
||||
|
|
|
|||
Loading…
Reference in New Issue