Skip to content

Commit

Permalink
Merge pull request #47792 from fastly/jkarneges/make-j
Browse files Browse the repository at this point in the history
pass -j to inner make, and ensure tests can build in parallel
  • Loading branch information
jkarneges authored Nov 20, 2023
2 parents 0d5b8fd + 5e8a0bb commit 149882e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 4 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use std::fs;
use std::io::{BufRead, BufReader};
use std::path::{Path, PathBuf};
use std::process::Command;
use std::thread;

fn main() -> Result<(), Box<dyn Error>> {
let conf = {
Expand Down Expand Up @@ -62,7 +63,10 @@ fn main() -> Result<(), Box<dyn Error>> {
.success());
}

let proc_count = thread::available_parallelism().map_or(1, |x| x.get());

assert!(Command::new(maketool)
.args(["-j", &proc_count.to_string()])
.current_dir(&cpp_src_dir)
.status()?
.success());
Expand Down
2 changes: 0 additions & 2 deletions src/cpp/tests/tests.pro
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ SRC_DIR = $$PWD/..
QZMQ_DIR = $$SRC_DIR/qzmq
RUST_DIR = $$SRC_DIR/../rust

PRE_TARGETDEPS += $$cpp_build_dir/libpushpin-cpp.a

include($$PWD/../../../conf.pri)

INCLUDEPATH += $$SRC_DIR
Expand Down

0 comments on commit 149882e

Please sign in to comment.