aboutsummaryrefslogtreecommitdiff
path: root/openssl/build.rs
blob: 8bb113acc2339373412c6925e8b8d3a4b81d1327 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use std::env;

fn main() {
    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_101").is_ok() {
        println!("cargo:rustc-cfg=ossl101");
        println!("cargo:rustc-cfg=ossl10x");
    }
    if let Ok(vars) = env::var("DEP_OPENSSL_OSSLCONF") {
        for var in vars.split(",") {
            println!("cargo:rustc-cfg=osslconf=\"{}\"", var);
        }
    }
}