File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ pub(crate) struct Env {
3636 pub ( crate ) android_ndk_home : Option < PathBuf > ,
3737 pub ( crate ) cmake_toolchain_file : Option < PathBuf > ,
3838 pub ( crate ) cpp_runtime_lib : Option < OsString > ,
39+ pub ( crate ) docs_rs : bool ,
3940}
4041
4142impl Config {
@@ -185,6 +186,7 @@ impl Env {
185186 android_ndk_home : target_var ( "ANDROID_NDK_HOME" ) . map ( Into :: into) ,
186187 cmake_toolchain_file : target_var ( "CMAKE_TOOLCHAIN_FILE" ) . map ( Into :: into) ,
187188 cpp_runtime_lib : target_var ( "BORING_BSSL_RUST_CPPLIB" ) ,
189+ docs_rs : var ( "DOCS_RS" ) . is_some ( ) ,
188190 }
189191 }
190192}
Original file line number Diff line number Diff line change @@ -656,6 +656,13 @@ fn get_cpp_runtime_lib(config: &Config) -> Option<String> {
656656
657657fn main ( ) {
658658 let config = Config :: from_env ( ) ;
659+ if !config. env . docs_rs {
660+ emit_link_directives ( & config) ;
661+ }
662+ generate_bindings ( & config) ;
663+ }
664+
665+ fn emit_link_directives ( config : & Config ) {
659666 let bssl_dir = built_boring_source_path ( & config) ;
660667 let build_path = get_boringssl_platform_output_path ( & config) ;
661668
@@ -702,7 +709,9 @@ fn main() {
702709 // Rust 1.87.0 compat - https://github.com/rust-lang/rust/pull/138233
703710 println ! ( "cargo:rustc-link-lib=advapi32" ) ;
704711 }
712+ }
705713
714+ fn generate_bindings ( config : & Config ) {
706715 let include_path = config. env . include_path . clone ( ) . unwrap_or_else ( || {
707716 if let Some ( bssl_path) = & config. env . path {
708717 return bssl_path. join ( "include" ) ;
You can’t perform that action at this time.
0 commit comments