Allow multiple --ide switches
Some users would like to use both a native ide and the json ide, but
currently only the last one specified is used and the others are
silently ignored. If there are multiple --ide switches, use all of them.
Change-Id: Ic28ea4d3e01ed2e8259c19075db4b946038514d0
Reviewed-on: https://gn-review.googlesource.com/c/gn/+/17100
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Dirk Pranke <dpranke@google.com>
diff --git a/src/gn/command_gen.cc b/src/gn/command_gen.cc
index 891ba91..c05ecd6 100644
--- a/src/gn/command_gen.cc
+++ b/src/gn/command_gen.cc
@@ -851,11 +851,11 @@
if (!CheckForInvalidGeneratedInputs(setup))
return 1;
- if (command_line->HasSwitch(kSwitchIde) &&
- !RunIdeWriter(command_line->GetSwitchValueString(kSwitchIde),
- &setup->build_settings(), setup->builder(), &err)) {
- err.PrintToStdout();
- return 1;
+ for (auto&& ide : command_line->GetSwitchValueStrings(kSwitchIde)) {
+ if (!RunIdeWriter(ide, &setup->build_settings(), setup->builder(), &err)) {
+ err.PrintToStdout();
+ return 1;
+ }
}
if (!RunCompileCommandsWriter(*setup, &err)) {