Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Allow configuring number of processes used for compiling. #103

Merged
merged 1 commit into from
Mar 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
🚀 feat: allow configuring the amount of processes used for compiling …
…via the MAKE_JOB_COUNT environment variable
  • Loading branch information
n1ru4l committed Aug 20, 2020
commit 1df6a5060db28072ff1cee913b5eb99df43bf171
4 changes: 3 additions & 1 deletion lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ async function compileOnWindows (nodeVersion, targetArch) {
return path.join(nodePath, 'out/Release/node.exe');
}

const { MAKE_JOB_COUNT = '1' } = process.env;

async function compileOnUnix (nodeVersion, targetArch) {
const args = [];
const cpu = { x86: 'ia32', x64: 'x64',
Expand All @@ -76,7 +78,7 @@ async function compileOnUnix (nodeVersion, targetArch) {
// TODO same for windows?
await spawn('./configure', args, { cwd: nodePath });
const make = hostPlatform === 'freebsd' ? 'gmake' : 'make';
const promise = spawn(make, [], { cwd: nodePath });
const promise = spawn(make, [ '-j', MAKE_JOB_COUNT ], { cwd: nodePath });
progress(promise, thresholds('make', nodeVersion));
await promise;
const output = path.join(nodePath, 'out/Release/node');
Expand Down