Skip to content

Commit

Permalink
[goma] USe depot_tools vended goma is present (flutter#22550)
Browse files Browse the repository at this point in the history
  • Loading branch information
iskakaushik authored Nov 17, 2020
1 parent 027fe50 commit e9d426a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tools/gn
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ def to_gn_args(args):

goma_dir = os.environ.get('GOMA_DIR')
goma_home_dir = os.path.join(os.getenv('HOME', ''), 'goma')
depot_tools_bin_dir = os.path.join(args.depot_tools, '.cipd_bin')

# GOMA has a different default (home) path on gWindows.
if not os.path.exists(goma_home_dir) and sys.platform.startswith(('cygwin', 'win')):
Expand All @@ -218,6 +219,9 @@ def to_gn_args(args):
elif args.goma and os.path.exists(goma_home_dir):
gn_args['use_goma'] = True
gn_args['goma_dir'] = goma_home_dir
elif args.goma and os.path.exists(depot_tools_bin_dir):
gn_args['use_goma'] = True
gn_args['goma_dir'] = depot_tools_bin_dir
else:
gn_args['use_goma'] = False
gn_args['goma_dir'] = None
Expand Down Expand Up @@ -326,6 +330,9 @@ def parse_args(args):

parser.add_argument('--goma', default=True, action='store_true')
parser.add_argument('--no-goma', dest='goma', action='store_false')
parser.add_argument('--depot-tools', default='~/depot_tools', type=str,
help='Depot tools provides an alternative location for gomacc in ' +
'/path/to/depot_tools/.cipd_bin')

parser.add_argument('--lto', default=True, action='store_true')
parser.add_argument('--no-lto', dest='lto', action='store_false')
Expand Down

0 comments on commit e9d426a

Please sign in to comment.