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

Commit e27c6e8

Browse files
authored
Forward custom IDE flags to GN. (#9023)
1 parent 6b4ca8d commit e27c6e8

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

tools/gn

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,10 @@ def parse_args(args):
315315
help='On the mac, the SDK is inferred from the Xcode location unless this flag is specified. ' +
316316
' Setting the FLUTTER_MAC_SDK_PATH environment variable achieves the same effect.')
317317

318+
parser.add_argument('--ide', default='', type=str,
319+
help='The IDE files to generate using GN. Use `gn gen help` and look for the --ide flag to' +
320+
' see supported IDEs. If this flag is not specified, a platform specific default is selected.')
321+
318322
return parser.parse_args(args)
319323

320324
def main(argv):
@@ -335,19 +339,20 @@ def main(argv):
335339
'--check',
336340
]
337341

338-
if sys.platform == 'darwin':
339-
# On the Mac, also generate Xcode projects for ease of editing.
342+
if args.ide != '':
343+
command.append('--ide=%s' % args.ide)
344+
elif sys.platform == 'darwin':
345+
# On the Mac, generate an Xcode project by default.
340346
command.append('--ide=xcode')
341-
342-
if sys.platform.startswith('win'):
343-
# On Windows, also generate Visual Studio project for ease of editing.
347+
elif sys.platform.startswith('win'):
348+
# On Windows, generate a Visual Studio project.
344349
command.append('--ide=vs')
345350

346351
gn_args = to_command_line(to_gn_args(args))
347352
out_dir = get_out_dir(args)
348-
print "gn gen --check in %s" % out_dir
349353
command.append(out_dir)
350354
command.append('--args=%s' % ' '.join(gn_args))
355+
print "Generating GN files in: %s" % out_dir
351356
gn_call_result = subprocess.call(command, cwd=SRC_ROOT)
352357

353358
if gn_call_result == 0:

0 commit comments

Comments
 (0)