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

Unified Diff: tools/gn/command_gen.cc

Issue 1649783003: Port "Eclipse CDT settings" file generation from GYP to GN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/BUILD.gn ('k') | tools/gn/eclipse_writer.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 b4faaa59a5e5710f2b6fdc4fcb8a58134ca7c6a1..7ba77896006c397047ef9385c9b4f7524a12684e 100644
--- a/tools/gn/command_gen.cc
+++ b/tools/gn/command_gen.cc
@@ -10,6 +10,7 @@
#include "base/timer/elapsed_timer.h"
#include "tools/gn/build_settings.h"
#include "tools/gn/commands.h"
+#include "tools/gn/eclipse_writer.h"
#include "tools/gn/ninja_target_writer.h"
#include "tools/gn/ninja_writer.h"
#include "tools/gn/runtime_deps.h"
@@ -26,6 +27,7 @@ namespace {
const char kSwitchCheck[] = "check";
const char kSwitchIde[] = "ide";
+const char kSwitchIdeValueEclipse[] = "eclipse";
const char kSwitchIdeValueVs[] = "vs";
// Called on worker thread to write the ninja file.
@@ -151,8 +153,16 @@ bool RunIdeWriter(const std::string& ide,
const BuildSettings* build_settings,
Builder* builder,
Err* err) {
- if (ide == kSwitchIdeValueVs) {
- base::ElapsedTimer timer;
+ base::ElapsedTimer timer;
+ if (ide == kSwitchIdeValueEclipse) {
+ bool res = EclipseWriter::RunAndWriteFile(build_settings, builder, err);
+ if (res) {
+ OutputString("Generating Eclipse settings took " +
+ base::Int64ToString(timer.Elapsed().InMilliseconds()) +
+ "ms\n");
+ }
+ return res;
+ } else if (ide == kSwitchIdeValueVs) {
bool res =
VisualStudioWriter::RunAndWriteFiles(build_settings, builder, err);
if (res &&
@@ -189,8 +199,20 @@ const char kGen_Help[] =
" --ide=<ide_name>\n"
" Also generate files for an IDE. Currently supported values:\n"
" 'vs' - Visual Studio project/solution files.\n"
+ " 'eclipse' - Eclipse CDT settings file.\n"
+ "\n"
+ " See \"gn help switches\" for the common command-line switches.\n"
+ "\n"
+ "Eclipse IDE Support\n"
"\n"
- " See \"gn help switches\" for the common command-line switches.\n";
+ " GN DOES NOT generate Eclipse CDT projects. Instead, it generates a\n"
+ " settings file which can be imported into an Eclipse CDT project. The\n"
+ " XML file contains a list of include paths and defines. Because GN does\n"
+ " not generate a full .cproject definition, it is not possible to\n"
+ " properly define includes/defines for each file individually.\n"
+ " Instead, one set of includes/defines is generated for the entire\n"
+ " project. This works fairly well but may still result in a few indexer\n"
+ " issues here and there.\n";
int RunGen(const std::vector<std::string>& args) {
base::ElapsedTimer timer;
« no previous file with comments | « tools/gn/BUILD.gn ('k') | tools/gn/eclipse_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698