aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2016-10-14 23:03:44 -0700
committerSteven Fackler <[email protected]>2016-10-14 23:03:44 -0700
commite1d1006fad87c885c256ead37f1de0c3fc8549ef (patch)
tree902acb2b86c41f006ceb72b3dbf84d0241cc42c7
parentPrefer 1.1 when looking for Homebrew installs (diff)
downloadrust-openssl-e1d1006fad87c885c256ead37f1de0c3fc8549ef.tar.xz
rust-openssl-e1d1006fad87c885c256ead37f1de0c3fc8549ef.zip
Check feature compatibility in build script
-rw-r--r--openssl/build.rs16
1 files changed, 11 insertions, 5 deletions
diff --git a/openssl/build.rs b/openssl/build.rs
index 15d4b4db..b67438e5 100644
--- a/openssl/build.rs
+++ b/openssl/build.rs
@@ -1,15 +1,21 @@
use std::env;
fn main() {
- if env::var("DEP_OPENSSL_IS_101").is_ok() {
- println!("cargo:rustc-cfg=ossl101");
- println!("cargo:rustc-cfg=ossl10x");
+ if env::var("DEP_OPENSSL_IS_110").is_ok() {
+ println!("cargo:rustc-cfg=ossl110");
+ return;
+ } else if cfg!(feature = "openssl-110") {
+ panic!("the openssl-110 feature is enabled but OpenSSL 1.1.0+ is not being linked against");
}
if env::var("DEP_OPENSSL_IS_102").is_ok() {
println!("cargo:rustc-cfg=ossl102");
println!("cargo:rustc-cfg=ossl10x");
+ return;
+ } else if cfg!(feature = "openssl-102") {
+ panic!("the openssl-102 feature is enabled but OpenSSL 1.0.2+")
}
- if env::var("DEP_OPENSSL_IS_110").is_ok() {
- println!("cargo:rustc-cfg=ossl110");
+ if env::var("DEP_OPENSSL_IS_101").is_ok() {
+ println!("cargo:rustc-cfg=ossl101");
+ println!("cargo:rustc-cfg=ossl10x");
}
}