Skip to content
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
6 changes: 4 additions & 2 deletions src/portable_python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,10 +605,12 @@ def run_configure(self, program, *args, prefix=None):

def run_make(self, *args, program="make", cpu_count=None):
cmd = program.split()
if cpu_count and cpu_count < 0:
if cpu_count is None:
available = multiprocessing.cpu_count()
# If we can't retrieve the number of cores, leave cpu_count as None
# and we'll omit -j below.
if available and available > 0:
cpu_count += available
cpu_count = available

if cpu_count and cpu_count > 1:
cmd.append("-j%s" % cpu_count)
Expand Down