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

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: Improve comment about "assert(product_type != "")" 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
« no previous file with comments | « tools/gn/bundle_data.h ('k') | tools/gn/commands.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/command_gen.cc
diff --git a/tools/gn/command_gen.cc b/tools/gn/command_gen.cc
index fee3f1a31f836c7843eac42afdeb918722c43413..74a5d90cfd3495b0530a6e679796b53b62b431a1 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,11 @@ 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 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 +193,19 @@ bool RunIdeWriter(const std::string& ide,
"ms\n");
}
return res;
+ } else if (ide == kSwitchIdeValueXcode) {
+ bool res = XcodeWriter::RunAndWriteFiles(
+ command_line->GetSwitchValueASCII(kSwitchWorkspace),
+ command_line->GetSwitchValueASCII(kSwitchRootTarget),
+ command_line->GetSwitchValueASCII(kSwitchNinjaExtraArgs),
+ command_line->GetSwitchValueASCII(kSwitchFilters), 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);
@@ -225,16 +243,35 @@ const char kGen_Help[] =
" (default Visual Studio version: 2015)\n"
" \"vs2013\" - Visual Studio 2013 project/solution files.\n"
" \"vs2015\" - Visual Studio 2015 project/solution files.\n"
- "\n"
- " --sln=<file_name>\n"
- " Override default sln file name (\"all\"). Solution file is written\n"
- " to the root build directory. Only for Visual Studio.\n"
+ " \"xcode\" - Xcode workspace/solution files.\n"
"\n"
" --filters=<path_prefixes>\n"
" Semicolon-separated list of label patterns used to limit the set\n"
" of generated projects (see \"gn help label_pattern\"). Only\n"
- " matching targets will be included to the solution. Only for Visual\n"
- " Studio.\n"
+ " matching targets will be included to the solution. Only used for\n"
+ " Visual Studio and Xcode.\n"
+ "\n"
+ "Visual Studio Flags\n"
+ "\n"
+ " --sln=<file_name>\n"
+ " Override default sln file name (\"all\"). Solution file is written\n"
+ " to the root build directory.\n"
+ "\n"
+ "Xcode Flags\n"
+ "\n"
+ " --workspace=<file_name>\n"
+ " Override defaut workspace file name (\"all\"). The workspace file\n"
+ " is written to the root build directory.\n"
+ "\n"
+ " --ninja-extra-args=<string>\n"
+ " This string is passed without any quoting to the ninja invocation\n"
+ " command-line. Can be used to configure ninja flags, like \"-j\" if\n"
+ " using goma for example.\n"
+ "\n"
+ " --root-target=<target_name>\n"
+ " Name of the target corresponding to \"All\" target in Xcode. If\n"
+ " unset, \"All\" invokes ninja without any target thus build all the\n"
+ " targets.\n"
"\n"
"Eclipse IDE Support\n"
"\n"
« no previous file with comments | « tools/gn/bundle_data.h ('k') | tools/gn/commands.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698