Skip to content

Commit b3d5f22

Browse files
committed
build.rs: always use freebsd12 when rustc_dep_of_std is set
1 parent acc7bb1 commit b3d5f22

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

build.rs

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,21 @@ fn main() {
4444
//
4545
// On CI, we detect the actual FreeBSD version and match its ABI exactly,
4646
// running tests to ensure that the ABI is correct.
47-
match which_freebsd() {
48-
Some(10) if libc_ci => set_cfg("freebsd10"),
49-
Some(11) if libc_ci => set_cfg("freebsd11"),
50-
Some(12) if libc_ci || rustc_dep_of_std => set_cfg("freebsd12"),
51-
Some(13) if libc_ci => set_cfg("freebsd13"),
52-
Some(14) if libc_ci => set_cfg("freebsd14"),
53-
Some(15) if libc_ci => set_cfg("freebsd15"),
54-
Some(_) | None => set_cfg("freebsd11"),
47+
let which_freebsd = if libc_ci {
48+
which_freebsd().unwrap_or(11)
49+
} else if rustc_dep_of_std {
50+
12
51+
} else {
52+
11
53+
};
54+
match which_freebsd {
55+
10 => set_cfg("freebsd10"),
56+
11 => set_cfg("freebsd11"),
57+
12 => set_cfg("freebsd12"),
58+
13 => set_cfg("freebsd13"),
59+
14 => set_cfg("freebsd14"),
60+
15 => set_cfg("freebsd15"),
61+
v => panic!("unsupported FreeBSD version: {}", v),
5562
}
5663

5764
match emcc_version_code() {

0 commit comments

Comments
 (0)