Skip to content

Commit 0d9a0f8

Browse files
authored
Append freebsd-version to all --target=*-freebsd if executed on FreeBSD. (#788)
1 parent 1997951 commit 0d9a0f8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1720,10 +1720,13 @@ impl Build {
17201720
} else if target.contains("aarch64") {
17211721
cmd.args.push("--target=aarch64-unknown-windows-gnu".into())
17221722
}
1723-
} else if target.ends_with("-freebsd") && self.get_host()?.eq(target) {
1723+
} else if target.ends_with("-freebsd") && self.get_host()?.ends_with("-freebsd")
1724+
{
17241725
// clang <= 13 on FreeBSD doesn't support a target triple without at least
17251726
// the major os version number appended; e.g. use x86_64-unknown-freebsd13
17261727
// or x86_64-unknown-freebsd13.0 instead of x86_64-unknown-freebsd.
1728+
// The current version is appended. If it doesn't align with your goals, pass
1729+
// .flag("--target=...") in the build script or adjust CXXFLAGS accordingly.
17271730
let stdout = std::process::Command::new("freebsd-version")
17281731
.output()
17291732
.map_err(|e| {

0 commit comments

Comments
 (0)