Skip to content

Commit

Permalink
allow supplying custom gn args in gn wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
selfisekai committed May 6, 2023
1 parent 393b564 commit 6f87607
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tools/gn
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,14 @@ def parse_args(args):
# Verbose output.
parser.add_argument('--verbose', default=False, action='store_true')

parser.add_argument(
'--gn-args',
action='append',
help='Additional gn args to be passed to gn. If you '
'need to use this, it should probably be another switch '
'in //flutter/tools/gn.',
)

return parser.parse_args(args)


Expand Down Expand Up @@ -1174,6 +1182,7 @@ def main(argv):
command.append('--export-compile-commands=default')

gn_args = to_command_line(to_gn_args(args))
gn_args.extend(args.gn_args or [])
out_dir = get_out_dir(args)
command.append(out_dir)
command.append('--args=%s' % ' '.join(gn_args))
Expand Down

0 comments on commit 6f87607

Please sign in to comment.