Commit 302432e1 authored by Felix Hädicke's avatar Felix Hädicke Committed by Max Kellermann

python/makeproject: set appropriate build jobs count depending on the number of CPUs

parent 4ab8a677
import subprocess
import subprocess, multiprocessing
from build.project import Project
......@@ -10,7 +10,12 @@ class MakeProject(Project):
self.install_target = install_target
def get_simultaneous_jobs(self):
return 12
try:
# use twice as many simultaneous jobs as we have CPU cores
return multiprocessing.cpu_count() * 2
except NotImplementedError:
# default to 12, if multiprocessing.cpu_count() is not implemented
return 12
def get_make_args(self, toolchain):
return ['--quiet', '-j' + str(self.get_simultaneous_jobs())]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment