Bug 837846 - Respect MOZ_MAKE_FLAGS when running make commands from mach. r=mshal

This commit is contained in:
Mike Hommey 2014-09-26 07:35:28 +09:00
parent bd8065dffa
commit 4de8112911

View File

@ -421,6 +421,26 @@ class MozbuildObject(ProcessExecutionMixin):
if filename:
args.extend(['-f', filename])
if num_jobs == 0 and self.mozconfig['make_flags']:
flags = iter(self.mozconfig['make_flags'])
for flag in flags:
if flag == '-j':
try:
flag = flags.next()
except StopIteration:
break
try:
num_jobs = int(flag)
except ValueError:
args.append(flag)
elif flag.startswith('-j'):
try:
num_jobs = int(flag[2:])
except (ValueError, IndexError):
break
else:
args.append(flag)
if allow_parallel:
if num_jobs > 0:
args.append('-j%d' % num_jobs)