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

Unified Diff: tools/gn/ninja_binary_target_writer.h

Issue 26267003: Add the concept of a source set to GN. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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/gn.gyp ('k') | tools/gn/ninja_binary_target_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/ninja_binary_target_writer.h
diff --git a/tools/gn/ninja_binary_target_writer.h b/tools/gn/ninja_binary_target_writer.h
index 047ed2a46cd2f272dad8fe5848615a8d4d2aa4b8..8c57ffb2743bf3921f58eadc7811808888044998 100644
--- a/tools/gn/ninja_binary_target_writer.h
+++ b/tools/gn/ninja_binary_target_writer.h
@@ -19,6 +19,8 @@ class NinjaBinaryTargetWriter : public NinjaTargetWriter {
virtual void Run() OVERRIDE;
private:
+ typedef std::set<OutputFile> OutputFileSet;
+
void WriteCompilerVars();
void WriteSources(std::vector<OutputFile>* object_files);
void WriteLinkerStuff(const std::vector<OutputFile>& object_files);
@@ -29,6 +31,32 @@ class NinjaBinaryTargetWriter : public NinjaTargetWriter {
const OutputFile& internal_output_file,
const std::vector<OutputFile>& object_files);
+ // Writes the stamp line for a source set. These are not linked.
+ void WriteSourceSetStamp(const std::vector<OutputFile>& object_files);
+
+ // Gets all target dependencies and classifies them, as well as accumulates
+ // object files from source sets we need to link.
+ void GetDeps(std::set<OutputFile>* extra_object_files,
+ std::vector<const Target*>* linkable_deps,
+ std::vector<const Target*>* non_linkable_deps) const;
+
+ // Classifies the dependency as linkable or nonlinkable with the current
+ // target, adding it to the appropriate vector. If the dependency is a source
+ // set we should link in, the source set's object files will be appended to
+ // |extra_object_files|.
+ void ClassifyDependency(const Target* dep,
+ std::set<OutputFile>* extra_object_files,
+ std::vector<const Target*>* linkable_deps,
+ std::vector<const Target*>* non_linkable_deps) const;
+
+ // Writes the implicit dependencies for the link or stamp line. This is
+ // the "||" and everything following it on the ninja line.
+ //
+ // The implicit dependencies are the non-linkable deps passed in as an
+ // argument, plus the data file depdencies in the target.
+ void WriteImplicitDependencies(
+ const std::vector<const Target*>& non_linkable_deps);
+
Toolchain::ToolType tool_type_;
DISALLOW_COPY_AND_ASSIGN(NinjaBinaryTargetWriter);
« no previous file with comments | « tools/gn/gn.gyp ('k') | tools/gn/ninja_binary_target_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698