diff --git a/python/build/makeproject.py b/python/build/makeproject.py index 667a10243..9ec95e27f 100644 --- a/python/build/makeproject.py +++ b/python/build/makeproject.py @@ -1,4 +1,4 @@ -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())]