@@ -62,17 +62,20 @@ fn main() {
6262
6363 // Create build configuration instance and enable in-source builds.
6464 let mut build_config = autotools:: Config :: new ( & tinydtls_src_dir) ;
65- build_config. insource ( true ) . out_dir ( & out_dir) ;
65+ build_config
66+ . insource ( true )
67+ . out_dir ( & out_dir)
68+ . make_args ( vec ! [ "-W" . to_string( ) , "doc" . to_string( ) ] ) ;
6669
6770 // Set Makeflags
6871 //build_config.make_args(make_flags);
6972
7073 // Enable debug symbols if enabled in Rust.
7174 match std:: env:: var_os ( "DEBUG" ) . unwrap ( ) . to_str ( ) . unwrap ( ) {
72- "0" | "false" => { }
75+ "0" | "false" => { } ,
7376 _ => {
7477 build_config. with ( "debug" , None ) ;
75- }
78+ } ,
7679 }
7780
7881 // Enable dependency features based on selected cargo features.
@@ -109,7 +112,6 @@ fn main() {
109112 // Customize and configure generated bindings.
110113 bindgen_builder = bindgen_builder
111114 . header ( "src/wrapper.h" )
112- . parse_callbacks ( Box :: new ( bindgen:: CargoCallbacks ) )
113115 . default_enum_style ( EnumVariation :: Rust { non_exhaustive : true } )
114116 . rustfmt_bindings ( false )
115117 // Some types cannot have `Debug` as they are packed and have non-Copy fields.
@@ -151,6 +153,13 @@ fn main() {
151153 . blocklist_type ( "__fd_mask" )
152154 // size_t matches usize in our case here.
153155 . size_t_is_usize ( true ) ;
156+ if !cfg ! ( feature = "vendored" ) {
157+ // Triggers a rebuild on every cargo build invocation if used for the vendored version, as
158+ // the included headers seem to come from our built version.
159+ // Should be fine though, as we already printed `cargo:rerun-if-changed=src/tinydtls/` at the
160+ // start of the file.
161+ bindgen_builder = bindgen_builder. parse_callbacks ( Box :: new ( bindgen:: CargoCallbacks ) ) ;
162+ }
154163
155164 // Run binding generation and write the output to a file.
156165 let bindings = bindgen_builder. generate ( ) . expect ( "Could not generate bindings!" ) ;
0 commit comments