Check for env var for pre-built binaries of bssl
This commit is contained in:
parent
9cb2e41e1f
commit
2e8ad14f59
|
|
@ -175,14 +175,17 @@ fn main() {
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
let mut cfg = get_boringssl_cmake_config();
|
let bssl_dir = std::env::var("BORING_BSSL_PATH").unwrap_or_else(|_| {
|
||||||
|
let mut cfg = get_boringssl_cmake_config();
|
||||||
|
|
||||||
if cfg!(feature = "fuzzing") {
|
if cfg!(feature = "fuzzing") {
|
||||||
cfg.cxxflag("-DBORINGSSL_UNSAFE_DETERMINISTIC_MODE")
|
cfg.cxxflag("-DBORINGSSL_UNSAFE_DETERMINISTIC_MODE")
|
||||||
.cxxflag("-DBORINGSSL_UNSAFE_FUZZER_MODE");
|
.cxxflag("-DBORINGSSL_UNSAFE_FUZZER_MODE");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cfg.build_target("bssl").build().display().to_string()
|
||||||
|
});
|
||||||
|
|
||||||
let bssl_dir = cfg.build_target("bssl").build().display().to_string();
|
|
||||||
let build_path = get_boringssl_platform_output_path();
|
let build_path = get_boringssl_platform_output_path();
|
||||||
let build_dir = format!("{}/build/{}", bssl_dir, build_path);
|
let build_dir = format!("{}/build/{}", bssl_dir, build_path);
|
||||||
println!("cargo:rustc-link-search=native={}", build_dir);
|
println!("cargo:rustc-link-search=native={}", build_dir);
|
||||||
|
|
@ -195,7 +198,11 @@ fn main() {
|
||||||
println!("cargo:rustc-cdylib-link-arg=-Wl,-undefined,dynamic_lookup");
|
println!("cargo:rustc-cdylib-link-arg=-Wl,-undefined,dynamic_lookup");
|
||||||
}
|
}
|
||||||
|
|
||||||
let include_path = PathBuf::from("deps/boringssl/src/include");
|
let include_path = PathBuf::from(
|
||||||
|
std::env::var("BORING_BSSL_INCLUDE_PATH")
|
||||||
|
.unwrap_or(String::from("deps/boringssl/src/include")),
|
||||||
|
);
|
||||||
|
|
||||||
let mut builder = bindgen::Builder::default()
|
let mut builder = bindgen::Builder::default()
|
||||||
.derive_copy(true)
|
.derive_copy(true)
|
||||||
.derive_debug(true)
|
.derive_debug(true)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue