Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(348)

Unified Diff: tools/gn/command_gen.cc

Issue 1827103005: [GN] Add support for generating Xcode projects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/gn/command_gen.cc
diff --git a/tools/gn/command_gen.cc b/tools/gn/command_gen.cc
index fee3f1a31f836c7843eac42afdeb918722c43413..474e2453588fb66d06a7f382ac571a7e7e54f84a 100644
--- a/tools/gn/command_gen.cc
+++ b/tools/gn/command_gen.cc
@@ -20,6 +20,7 @@
#include "tools/gn/switches.h"
#include "tools/gn/target.h"
#include "tools/gn/visual_studio_writer.h"
+#include "tools/gn/xcode_writer.h"
namespace commands {
@@ -32,7 +33,12 @@ const char kSwitchIdeValueEclipse[] = "eclipse";
const char kSwitchIdeValueVs[] = "vs";
const char kSwitchIdeValueVs2013[] = "vs2013";
const char kSwitchIdeValueVs2015[] = "vs2015";
+const char kSwitchIdeValueXcode[] = "xcode";
+const char kSwitchNinjaExtraArgs[] = "ninja-extra-args";
+const char kSwitchPattern[] = "pattern";
+const char kSwitchRootTarget[] = "root-target";
const char kSwitchSln[] = "sln";
+const char kSwitchWorkspace[] = "workspace";
// Called on worker thread to write the ninja file.
void BackgroundDoWrite(const Target* target) {
@@ -188,6 +194,19 @@ bool RunIdeWriter(const std::string& ide,
"ms\n");
}
return res;
+ } else if (ide == kSwitchIdeValueXcode) {
+ bool res = XcodeWriter::RunAndWriteFiles(
+ command_line->GetSwitchValueNative(kSwitchWorkspace),
+ command_line->GetSwitchValueNative(kSwitchRootTarget),
+ command_line->GetSwitchValueNative(kSwitchNinjaExtraArgs),
+ command_line->GetSwitchValueNative(kSwitchPattern), build_settings,
+ builder, err);
+ if (res && !command_line->HasSwitch(switches::kQuiet)) {
+ OutputString("Generating Xcode projects took " +
+ base::Int64ToString(timer.Elapsed().InMilliseconds()) +
+ "ms\n");
+ }
+ return res;
}
*err = Err(Location(), "Unknown IDE: " + ide);

Powered by Google App Engine
This is Rietveld 408576698