Skip to content

Commit

Permalink
build.rs: always use freebsd12 when rustc_dep_of_std is set
Browse files Browse the repository at this point in the history
(backport <rust-lang#3723>)
(cherry picked from commit b358c8f)
  • Loading branch information
RalfJung authored and tgross35 committed Aug 17, 2024
1 parent 20a1175 commit 9e43d14
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,21 @@ fn main() {
//
// On CI, we detect the actual FreeBSD version and match its ABI exactly,
// running tests to ensure that the ABI is correct.
match which_freebsd() {
Some(10) if libc_ci => set_cfg("freebsd10"),
Some(11) if libc_ci => set_cfg("freebsd11"),
Some(12) if libc_ci || rustc_dep_of_std => set_cfg("freebsd12"),
Some(13) if libc_ci => set_cfg("freebsd13"),
Some(14) if libc_ci => set_cfg("freebsd14"),
Some(15) if libc_ci => set_cfg("freebsd15"),
Some(_) | None => set_cfg("freebsd11"),
let which_freebsd = if libc_ci {
which_freebsd().unwrap_or(11)
} else if rustc_dep_of_std {
12
} else {
11
};
match which_freebsd {
x if x < 10 => panic!("FreeBSD older than 10 is not supported"),
10 => set_cfg("freebsd10"),
11 => set_cfg("freebsd11"),
12 => set_cfg("freebsd12"),
13 => set_cfg("freebsd13"),
14 => set_cfg("freebsd14"),
_ => set_cfg("freebsd15"),
}

match emcc_version_code() {
Expand Down

0 comments on commit 9e43d14

Please sign in to comment.