Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Unified Diff: tools/build.py

Issue 2559303002: GN: Pass a better -j option when using goma (Closed)
Patch Set: Restore goma to the default in all cases Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/build.py
diff --git a/tools/build.py b/tools/build.py
index 4f5d2e1606dcc26ca2573f0a54c8a5d4e9cee4da..e30b1f81ce80c4d036254305798b7c9afdb01719 100755
--- a/tools/build.py
+++ b/tools/build.py
@@ -416,13 +416,26 @@ def RunGN(target_os, mode, arch):
print ("Tried to run GN, but it failed. Try running it manually: \n\t$ " +
' '.join(gn_command))
+
+def ShouldRunGN(out_dir):
+ return (not os.path.exists(out_dir) or
+ not os.path.isfile(os.path.join(out_dir, 'args.gn')))
+
+
+def UseGoma(out_dir):
+ args_gn = os.path.join(out_dir, 'args.gn')
+ return 'use_goma = true' in open(args_gn, 'r').read()
+
+
def BuildNinjaCommand(options, target, target_os, mode, arch):
out_dir = utils.GetBuildRoot(HOST_OS, mode, arch, target_os)
- if not os.path.exists(out_dir):
+ if ShouldRunGN(out_dir):
RunGN(target_os, mode, arch)
command = ['ninja', '-C', out_dir]
if options.verbose:
command += ['-v']
+ if UseGoma(out_dir):
+ command += ['-j200']
command += [target]
return command
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698