Skip to content

Commit

Permalink
Disable parallel build on machine with small RAM
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Oct 31, 2024
1 parent 97dc48f commit f60de8b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,7 @@ if (!fs.existsSync(stampFile) || fs.readFileSync(stampFile).toString() != stamp)
fs.writeFileSync(stampFile, stamp)
}

// Run building.
await $`cmake --build ${outDir} --config Release -j`
// Limit parallel jobs if running on a machine with small RAM, otherwise linking
// may take too much time due to swapping.
const jobs = os.totalmem() < 10 * Math.pow(1024, 3) ? 1 : ''
await $`cmake --build ${outDir} --config Release -j ${jobs}`

0 comments on commit f60de8b

Please sign in to comment.