-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.rs
More file actions
22 lines (17 loc) · 745 Bytes
/
build.rs
File metadata and controls
22 lines (17 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use std::{env, process};
fn main() {
// Prevent unnecessary rerunning of this build script
println!("cargo:rerun-if-changed=build.rs");
let tls_features = [
("tls-native", env::var_os("CARGO_FEATURE_TLS_NATIVE").is_some()),
("tls-rustls-native-roots", env::var_os("CARGO_FEATURE_TLS_RUSTLS_NATIVE_ROOTS").is_some()),
("tls-rustls-webpki-roots", env::var_os("CARGO_FEATURE_TLS_RUSTLS_WEBPKI_ROOTS").is_some()),
];
if tls_features.iter().filter(|(_, a)| *a).count() > 1 {
eprintln!("error: Only one tls features can be enabled.");
for (f, a) in &tls_features {
eprintln!(" {f}: {}", if *a { "enabled" } else { "disabled" });
}
process::exit(1);
}
}