Skip to content

Commit

Permalink
Always set num_jobs in make_args
Browse files Browse the repository at this point in the history
  • Loading branch information
citizen-stig authored and lu-zero committed Apr 4, 2024
1 parent ff4578c commit 0831443
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -688,25 +688,25 @@ impl Config {
make_args.extend_from_slice(args);
}

if let Ok(s) = env::var("NUM_JOBS") {
if let Ok(num_jobs_s) = env::var("NUM_JOBS") {
// This looks like `make`, let's hope it understands `-jN`.
make_args.push(format!("-j{}", num_jobs_s));
match env::var_os("CARGO_MAKEFLAGS") {
// Only do this on non-windows and non-bsd
// On Windows, we could be invoking make instead of
// mingw32-make which doesn't work with our jobserver
// bsdmake also does not work with our job server
Some(ref s)
Some(ref cargo_make_flags)
if !(cfg!(windows)
|| cfg!(target_os = "openbsd")
|| cfg!(target_os = "netbsd")
|| cfg!(target_os = "freebsd")
|| cfg!(target_os = "bitrig")
|| cfg!(target_os = "dragonflybsd")) =>
{
makeflags = Some(s.clone())
makeflags = Some(cargo_make_flags.clone())
}

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

Expand Down

0 comments on commit 0831443

Please sign in to comment.