File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -137,6 +137,20 @@ fn create_bindgen_builder(header: &PathBuf) -> Result<Option<Builder>, Error> {
137
137
}
138
138
}
139
139
140
+ // Windows platform has various different conventions than *nix platforms,
141
+ // e.g. default enum underlying type, struct padding, mangling. Most tests
142
+ // were written and checked on Linux and macOS, and thus they could fail on
143
+ // Windows. We just make those tests targetting Linux instead as far as one
144
+ // isn't annotated for a specific target.
145
+ if cfg ! ( target_os = "windows" ) {
146
+ if flags. iter ( ) . all ( |flag| !flag. starts_with ( "--target=" ) ) {
147
+ if !flags. iter ( ) . any ( |flag| flag == "--" ) {
148
+ flags. push ( "--" . into ( ) ) ;
149
+ }
150
+ flags. push ( "--target=x86_64-unknown-linux" . into ( ) ) ;
151
+ }
152
+ }
153
+
140
154
// Fool builder_from_flags() into believing it has real env::args_os...
141
155
// - add "bindgen" as executable name 0th element
142
156
// - add header filename as 1st element
You can’t perform that action at this time.
0 commit comments