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

Unified Diff: tools/gn/eclipse_writer.h

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/command_gen.cc ('k') | tools/gn/eclipse_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/eclipse_writer.h
diff --git a/tools/gn/eclipse_writer.h b/tools/gn/eclipse_writer.h
new file mode 100644
index 0000000000000000000000000000000000000000..560b8729e02fc177aa265ef3639c0603207359fd
--- /dev/null
+++ b/tools/gn/eclipse_writer.h
@@ -0,0 +1,67 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef TOOLS_GN_ECLIPSE_WRITER_H_
+#define TOOLS_GN_ECLIPSE_WRITER_H_
+
+#include <iosfwd>
+#include <map>
+#include <set>
+#include <string>
+#include <vector>
+
+#include "base/macros.h"
+
+class BuildSettings;
+class Builder;
+class Err;
+class Target;
+
+class EclipseWriter {
+ public:
+ static bool RunAndWriteFile(const BuildSettings* build_settings,
+ const Builder* builder,
+ Err* err);
+
+ private:
+ EclipseWriter(const BuildSettings* build_settings,
+ const Builder* builder,
+ std::ostream& out);
+ ~EclipseWriter();
+
+ void Run();
+
+ // Populates |include_dirs_| with the include dirs of all the targets for the
+ // default toolchain.
+ void GetAllIncludeDirs();
+
+ // Populates |defines_| with the defines of all the targets for the default
+ // toolchain.
+ void GetAllDefines();
+
+ // Returns true if |target| uses the default toolchain.
+ bool UsesDefaultToolchain(const Target* target) const;
+
+ // Writes the XML settings file.
+ void WriteCDTSettings();
+
+ const BuildSettings* build_settings_;
+ const Builder* builder_;
+
+ // The output stream for the settings file.
+ std::ostream& out_;
+
+ // Eclipse languages for which the include dirs and defines apply.
+ std::vector<std::string> languages_;
+
+ // The include dirs of all the targets which use the default toolchain.
+ std::set<std::string> include_dirs_;
+
+ // The defines of all the targets which use the default toolchain.
+ std::map<std::string, std::string> defines_;
+
+ DISALLOW_COPY_AND_ASSIGN(EclipseWriter);
+};
+
+#endif // TOOLS_GN_ECLIPSE_WRITER_H_
« no previous file with comments | « tools/gn/command_gen.cc ('k') | tools/gn/eclipse_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698