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

Commit 35c37e8

Browse files
selfisekaieseidel
authored andcommitted
allow supplying custom gn args in gn wrapper (flutter#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 814cd8e commit 35c37e8

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
@@ -1028,6 +1028,14 @@ def parse_args(args):
10281028
# Verbose output.
10291029
parser.add_argument('--verbose', default=False, action='store_true')
10301030

1031+
parser.add_argument(
1032+
'--gn-args',
1033+
action='append',
1034+
help='Additional gn args to be passed to gn. If you '
1035+
'need to use this, it should probably be another switch '
1036+
'in //flutter/tools/gn.',
1037+
)
1038+
10311039
return parser.parse_args(args)
10321040

10331041

@@ -1080,6 +1088,7 @@ def main(argv):
10801088
command.append('--export-compile-commands=default')
10811089

10821090
gn_args = to_command_line(to_gn_args(args))
1091+
gn_args.extend(args.gn_args or [])
10831092
out_dir = get_out_dir(args)
10841093
command.append(out_dir)
10851094
command.append('--args=%s' % ' '.join(gn_args))

0 commit comments

Comments
 (0)