-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.rs
21 lines (19 loc) · 988 Bytes
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use std::{env, process};
fn main() {
if env::var_os("CARGO_FEATURE_ASYNC_TOKIO").is_some() {
match (env::var_os("CARGO_FEATURE_TLS_OPENSSL"), env::var_os("CARGO_FEATURE_TLS_OPENSSL_TOKIO")) {
(Some(_), None) => { fatal("to enable the features `tls_openssl` and `async_tokio` together, you must also enable the `tls_openssl_tokio` feature") },
(None, Some(_)) => { fatal("feature `tls_openssl_tokio` enabled without `tls_openssl`") },
_ => {},
}
match (env::var_os("CARGO_FEATURE_TLS_RUSTLS"), env::var_os("CARGO_FEATURE_TLS_RUSTLS_TOKIO")) {
(Some(_), None) => { fatal("to enable the features `tls_rustls` and `async_tokio` together, you must also enable the `tls_rustls_tokio` feature") },
(None, Some(_)) => { fatal("feature `tls_rustls_tokio` enabled without `tls_rustls`") },
_ => {},
}
}
}
fn fatal(msg: &str) {
eprintln!("error: {}", msg);
process::exit(1);
}