-
Notifications
You must be signed in to change notification settings - Fork 0
/
gn-parallel.patch
28 lines (25 loc) · 1.09 KB
/
gn-parallel.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
description: respect specified number of parallel jobs while bootstrapping gn
author: Michael Gilbert <[email protected]>
--- a/tools/gn/bootstrap/bootstrap.py
+++ b/tools/gn/bootstrap/bootstrap.py
@@ -47,6 +47,7 @@ def main(argv):
help='The directory in which to build gn, '
'relative to the src directory. (eg. out/Release)')
parser.add_option('-v', '--verbose', help='ignored')
+ parser.add_option('-j', '--jobs', help='Number of jobs')
parser.add_option(
'--skip-generate-buildfiles',
action='store_true',
@@ -78,8 +79,12 @@ def main(argv):
shutil.copy2(
os.path.join(BOOTSTRAP_DIR, 'last_commit_position.h'), gn_build_dir)
- subprocess.check_call(
- ['ninja', '-C', gn_build_dir, 'gn', '-w', 'dupbuild=err'])
+ if options.jobs:
+ subprocess.check_call(
+ ['ninja', '-C', gn_build_dir, 'gn', '-w', 'dupbuild=err', '-j'+str(options.jobs)])
+ else:
+ subprocess.check_call(
+ ['ninja', '-C', gn_build_dir, 'gn', '-w', 'dupbuild=err'])
shutil.copy2(os.path.join(gn_build_dir, 'gn'), gn_path)
if not options.skip_generate_buildfiles: