Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 1f94476

Browse files
authored
allow supplying custom gn args in gn wrapper (#41794)
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
1 parent 70d7c5f commit 1f94476

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tools/gn

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,14 @@ def parse_args(args):
11161116
# Verbose output.
11171117
parser.add_argument('--verbose', default=False, action='store_true')
11181118

1119+
parser.add_argument(
1120+
'--gn-args',
1121+
action='append',
1122+
help='Additional gn args to be passed to gn. If you '
1123+
'need to use this, it should probably be another switch '
1124+
'in //flutter/tools/gn.',
1125+
)
1126+
11191127
return parser.parse_args(args)
11201128

11211129

@@ -1171,6 +1179,7 @@ def main(argv):
11711179
command.append('--export-compile-commands=default')
11721180

11731181
gn_args = to_command_line(to_gn_args(args))
1182+
gn_args.extend(args.gn_args or [])
11741183
out_dir = get_out_dir(args)
11751184
command.append(out_dir)
11761185
command.append('--args=%s' % ' '.join(gn_args))

0 commit comments

Comments
 (0)