Skip to content

Commit 12aa62b

Browse files
committed
Add jobserver support
1 parent f260a80 commit 12aa62b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

jemalloc-sys/build.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,14 @@ fn main() {
302302

303303
// Make:
304304
let make = make_cmd(&host);
305-
run(Command::new(make)
306-
.current_dir(&build_dir)
307-
.arg("-j")
308-
.arg(num_jobs.clone()));
305+
let mut cmd = Command::new(make);
306+
cmd.current_dir(&build_dir);
307+
if let Ok(makeflags) = std::env::var("CARGO_MAKEFLAGS") {
308+
cmd.env("MAKEFLAGS", makeflags);
309+
} else {
310+
cmd.arg("-j").arg(num_jobs.clone());
311+
}
312+
run(&mut cmd);
309313

310314
// Skip watching this environment variables to avoid rebuild in CI.
311315
if env::var("JEMALLOC_SYS_RUN_JEMALLOC_TESTS").is_ok() {

0 commit comments

Comments
 (0)