@@ -62,17 +62,20 @@ fn main() {
62
62
63
63
// Create build configuration instance and enable in-source builds.
64
64
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( ) ] ) ;
66
69
67
70
// Set Makeflags
68
71
//build_config.make_args(make_flags);
69
72
70
73
// Enable debug symbols if enabled in Rust.
71
74
match std:: env:: var_os ( "DEBUG" ) . unwrap ( ) . to_str ( ) . unwrap ( ) {
72
- "0" | "false" => { }
75
+ "0" | "false" => { } ,
73
76
_ => {
74
77
build_config. with ( "debug" , None ) ;
75
- }
78
+ } ,
76
79
}
77
80
78
81
// Enable dependency features based on selected cargo features.
@@ -109,7 +112,6 @@ fn main() {
109
112
// Customize and configure generated bindings.
110
113
bindgen_builder = bindgen_builder
111
114
. header ( "src/wrapper.h" )
112
- . parse_callbacks ( Box :: new ( bindgen:: CargoCallbacks ) )
113
115
. default_enum_style ( EnumVariation :: Rust { non_exhaustive : true } )
114
116
. rustfmt_bindings ( false )
115
117
// Some types cannot have `Debug` as they are packed and have non-Copy fields.
@@ -151,6 +153,13 @@ fn main() {
151
153
. blocklist_type ( "__fd_mask" )
152
154
// size_t matches usize in our case here.
153
155
. 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
+ }
154
163
155
164
// Run binding generation and write the output to a file.
156
165
let bindings = bindgen_builder. generate ( ) . expect ( "Could not generate bindings!" ) ;
0 commit comments