Skip to content

Commit d8f27eb

Browse files
committed
Make the default target for expectation files as x86_64-unknown-linux
1 parent bd5f928 commit d8f27eb

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

tests/headers/call-conv-field.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// bindgen-flags: -- -target i686-pc-win32
1+
// bindgen-flags: -- --target=i686-pc-win32
22
// bindgen-unstable
33
// bindgen-generate-bindings-on-linux-only
44
//

tests/tests.rs

+6-11
Original file line numberDiff line numberDiff line change
@@ -235,18 +235,13 @@ fn create_bindgen_builder(header: &PathBuf) -> Result<Option<Builder>, Error> {
235235
}
236236
}
237237

238-
// Windows platform has various different conventions than *nix platforms,
239-
// e.g. default enum underlying type, struct padding, mangling. Most tests
240-
// were written and checked on Linux and macOS, and thus they could fail on
241-
// Windows. We just make those tests targetting Linux instead as far as one
242-
// isn't annotated for a specific target.
243-
if cfg!(target_os = "windows") {
244-
if flags.iter().all(|flag| !flag.starts_with("--target=")) {
245-
if !flags.iter().any(|flag| flag == "--") {
246-
flags.push("--".into());
247-
}
248-
flags.push("--target=x86_64-unknown-linux".into());
238+
// Different platforms have various different conventions like struct padding, mangling, etc.
239+
// We make the default target as x86_64-unknown-linux
240+
if flags.iter().all(|flag| !flag.starts_with("--target=")) {
241+
if !flags.iter().any(|flag| flag == "--") {
242+
flags.push("--".into());
249243
}
244+
flags.push("--target=x86_64-unknown-linux".into());
250245
}
251246

252247
// Fool builder_from_flags() into believing it has real env::args_os...

0 commit comments

Comments
 (0)