Don't always require all headers from all versions of BoringSSL
This commit is contained in:
parent
d0973d7617
commit
9cc97c87c7
@ -704,7 +704,7 @@ fn generate_bindings(config: &Config) {
|
||||
}
|
||||
}
|
||||
|
||||
let headers = [
|
||||
let must_have_headers = [
|
||||
"aes.h",
|
||||
"asn1_mac.h",
|
||||
"asn1t.h",
|
||||
@ -720,6 +720,12 @@ fn generate_bindings(config: &Config) {
|
||||
"err.h",
|
||||
"hkdf.h",
|
||||
"hpke.h",
|
||||
"ossl_typ.h",
|
||||
"pkcs12.h",
|
||||
"poly1305.h",
|
||||
"x509v3.h",
|
||||
];
|
||||
let headers = [
|
||||
"hmac.h",
|
||||
"hrss.h",
|
||||
"md4.h",
|
||||
@ -728,27 +734,25 @@ fn generate_bindings(config: &Config) {
|
||||
"obj_mac.h",
|
||||
"objects.h",
|
||||
"opensslv.h",
|
||||
"ossl_typ.h",
|
||||
"pkcs12.h",
|
||||
"poly1305.h",
|
||||
"rand.h",
|
||||
"rc4.h",
|
||||
"ripemd.h",
|
||||
"siphash.h",
|
||||
"srtp.h",
|
||||
"trust_token.h",
|
||||
"x509v3.h",
|
||||
];
|
||||
for header in &headers {
|
||||
for (i, header) in must_have_headers.into_iter().chain(headers).enumerate() {
|
||||
let header_path = include_path.join("openssl").join(header);
|
||||
if !header_path.exists() {
|
||||
if header_path.exists() {
|
||||
builder = builder.header(header_path.to_str().unwrap());
|
||||
} else {
|
||||
let err = format!("'openssl/{header}' is missing from '{}'. The include path may be incorrect or contain an outdated version of OpenSSL/BoringSSL", include_path.display());
|
||||
let required = i < must_have_headers.len();
|
||||
println!(
|
||||
"cargo::warning={} is missing. Is {} correct?",
|
||||
header_path.display(),
|
||||
include_path.display()
|
||||
"cargo::{}={err}",
|
||||
if required { "error" } else { "warning" }
|
||||
);
|
||||
}
|
||||
builder = builder.header(header_path.to_str().unwrap());
|
||||
}
|
||||
|
||||
let bindings = builder.generate().expect("Unable to generate bindings");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user