Skip to content

Commit

Permalink
Append freebsd-version to all --target=*-freebsd if executed on Fre…
Browse files Browse the repository at this point in the history
…eBSD. (#788)
  • Loading branch information
dot-asm authored Feb 5, 2023
1 parent 1997951 commit 0d9a0f8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1720,10 +1720,13 @@ impl Build {
} else if target.contains("aarch64") {
cmd.args.push("--target=aarch64-unknown-windows-gnu".into())
}
} else if target.ends_with("-freebsd") && self.get_host()?.eq(target) {
} else if target.ends_with("-freebsd") && self.get_host()?.ends_with("-freebsd")
{
// clang <= 13 on FreeBSD doesn't support a target triple without at least
// the major os version number appended; e.g. use x86_64-unknown-freebsd13
// or x86_64-unknown-freebsd13.0 instead of x86_64-unknown-freebsd.
// The current version is appended. If it doesn't align with your goals, pass
// .flag("--target=...") in the build script or adjust CXXFLAGS accordingly.
let stdout = std::process::Command::new("freebsd-version")
.output()
.map_err(|e| {
Expand Down

0 comments on commit 0d9a0f8

Please sign in to comment.