Allow configuring number of processes used for compiling. (#103)

This commit is contained in:
Laurin Quast 2021-03-01 16:37:57 +01:00 committed by GitHub
parent eef90fed0f
commit 170c3adff9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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',
@ -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');