Skip to content

Commit

Permalink
allow supplying custom gn args in gn wrapper (flutter#41794)
Browse files Browse the repository at this point in the history
allows to supply gn args that do not have their cli switches (yet), like this:
```sh
python3 ./tools/gn --gn-args 'use_default_linux_sysroot=false'
```

*List which issues are fixed by this PR. You must list at least one issue.*
flutter/flutter#126197

*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
  • Loading branch information
selfisekai authored and eseidel committed Jun 8, 2023
1 parent 814cd8e commit 35c37e8
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 @@ -1028,6 +1028,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 @@ -1080,6 +1088,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 35c37e8

Please sign in to comment.