2022-02-20 03:43:38 +01:00
|
|
|
// include!("src/lib/audit_loglevel.rs");
|
2021-03-26 02:22:00 +01:00
|
|
|
|
2023-08-14 11:39:49 +02:00
|
|
|
use hashbrown::HashMap;
|
|
|
|
|
2022-11-04 05:48:00 +01:00
|
|
|
use std::env;
|
|
|
|
|
2021-02-13 04:46:22 +01:00
|
|
|
fn main() {
|
2022-11-04 05:48:00 +01:00
|
|
|
if let Ok(v) = env::var("DEP_OPENSSL_VERSION_NUMBER") {
|
|
|
|
let version = u64::from_str_radix(&v, 16).unwrap();
|
|
|
|
|
2022-11-11 01:23:49 +01:00
|
|
|
if version >= 0x3000_0000 {
|
2022-11-04 05:48:00 +01:00
|
|
|
println!("cargo:rustc-cfg=openssl3");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-20 03:43:38 +01:00
|
|
|
profiles::apply_profile();
|
2023-08-14 11:39:49 +02:00
|
|
|
|
|
|
|
// check we don't have duplicate UUIDs
|
|
|
|
let uuid_filename = format!(
|
|
|
|
"{}/{}",
|
|
|
|
env!("CARGO_MANIFEST_DIR"),
|
|
|
|
"src/constants/uuids.rs"
|
|
|
|
);
|
|
|
|
let constants = std::fs::read_to_string(uuid_filename).unwrap();
|
|
|
|
let mut uuids: HashMap<String, usize> = HashMap::new();
|
|
|
|
let uuid_finder = regex::Regex::new(r#"uuid!\(\"([^\"]+)"#).unwrap();
|
|
|
|
|
|
|
|
for line in constants.lines() {
|
|
|
|
if let Some(caps) = uuid_finder.captures(line) {
|
|
|
|
let uuid = caps.get(1).unwrap().as_str();
|
|
|
|
let count = uuids.entry(uuid.to_string()).or_insert(0);
|
|
|
|
*count += 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (uuid, count) in uuids {
|
|
|
|
if count > 1 {
|
|
|
|
panic!("duplicate UUID: {}", uuid);
|
|
|
|
}
|
|
|
|
}
|
2021-02-13 04:46:22 +01:00
|
|
|
}
|