Skip to content

Commit 77cfe87

Browse files
committed
Don't pass through CARGO_MAKEFLAGS args on BSD platforms
These are incompatible with bsdmake, and will cause failures in any packages that use this lib on systems where make == bsdmake.
1 parent c1fd52a commit 77cfe87

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/lib.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -495,10 +495,17 @@ impl Config {
495495
}
496496
_ if fs::metadata(&dst.join("build/Makefile")).is_ok() => {
497497
match env::var_os("CARGO_MAKEFLAGS") {
498-
// Only do this on non-windows as we could actually be
499-
// invoking make instead of mingw32-make which doesn't
500-
// work with our jobserver
501-
Some(ref s) if !cfg!(windows) => makeflags = Some(s.clone()),
498+
// Only do this on non-windows and non-bsd
499+
// On Windows, we could be invoking make instead of
500+
// mingw32-make which doesn't work with our jobserver
501+
// bsdmake also does not work with our job server
502+
Some(ref s) if !(cfg!(windows) ||
503+
cfg!(target_os = "openbsd") ||
504+
cfg!(target_os = "netbsd") ||
505+
cfg!(target_os = "freebsd") ||
506+
cfg!(target_os = "bitrig") ||
507+
cfg!(target_os = "dragonflybsd")
508+
) => makeflags = Some(s.clone()),
502509

503510
// This looks like `make`, let's hope it understands `-jN`.
504511
_ => parallel_args.push(format!("-j{}", s)),

0 commit comments

Comments
 (0)