Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
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
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):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would have to go above the args.goma case wouldn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is correct. Theres 3 cases:

  • Priority 1: args.goma and goma_dir is present.
  • Priority 2: args.goma and goma_home_dir is present.
  • Priority 3: args.goma and (none of the other two are present + depot_tools dir is present.)

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