Skip to content

Commit

Permalink
allow supplying custom gn args in gn wrapper (#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 committed May 11, 2023
1 parent 70d7c5f commit 1f94476
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tools/gn
Expand Up @@ -1116,6 +1116,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 @@ -1171,6 +1179,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 1f94476

Please sign in to comment.