From 998f826cb9452db2dd32dd3b5e05ca9b41f041e7 Mon Sep 17 00:00:00 2001 From: "lauren n. liberda" Date: Thu, 11 May 2023 22:13:50 +0200 Subject: [PATCH] allow supplying custom gn args in gn wrapper (flutter/engine#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.* https://github.com/flutter/flutter/issues/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 --- engine/src/flutter/tools/gn | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/engine/src/flutter/tools/gn b/engine/src/flutter/tools/gn index 92c8bd84d9e..1b2b52fc9e5 100755 --- a/engine/src/flutter/tools/gn +++ b/engine/src/flutter/tools/gn @@ -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) @@ -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))