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

Unified Diff: tools/gn/ninja_target_writer.h

Issue 440333002: Support more configurability in GN toolchains (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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/ninja_target_writer.h
diff --git a/tools/gn/ninja_target_writer.h b/tools/gn/ninja_target_writer.h
index 6cd0a0ad8a9113ab0bc9d24b61563f4bef59e7e5..e2dbd25cc2164be399e3156e7bf4de329e330e78 100644
--- a/tools/gn/ninja_target_writer.h
+++ b/tools/gn/ninja_target_writer.h
@@ -8,8 +8,8 @@
#include <iosfwd>
#include "base/basictypes.h"
-#include "tools/gn/ninja_helper.h"
#include "tools/gn/path_output.h"
+#include "tools/gn/substitution_type.h"
jamesr 2014/08/19 19:30:41 could just forward declare SubstitutionBits, but t
class FileTemplate;
class Settings;
@@ -19,16 +19,19 @@ class Target;
// generated by the NinjaBuildWriter.
class NinjaTargetWriter {
public:
- NinjaTargetWriter(const Target* target,
- const Toolchain* toolchain,
- std::ostream& out);
+ NinjaTargetWriter(const Target* target, std::ostream& out);
virtual ~NinjaTargetWriter();
- static void RunAndWriteFile(const Target* target, const Toolchain* toolchain);
+ static void RunAndWriteFile(const Target* target);
virtual void Run() = 0;
protected:
+ // Writes out the substitution values that are shared between the different
+ // types of tools (target gen dir, target label, etc.). Only the substitutions
+ // identified by the given bits will be written.
+ void WriteSharedVars(const SubstitutionBits& bits);
+
// Writes to the output stream a stamp rule for input dependencies, and
// returns the string to be appended to source rules that encodes the
// order-only dependencies for the current target. This will include the "|"
@@ -38,14 +41,17 @@ class NinjaTargetWriter {
std::string WriteInputDepsStampAndGetDep(
const std::vector<const Target*>& extra_hard_deps) const;
+ // Writes to the output file a final stamp rule for the target that stamps
+ // the given list of files. This function assumes the stamp is for the target
+ // as a whole so the stamp file is set as the target's dependency output.
+ void WriteStampForTarget(const std::vector<OutputFile>& deps,
+ const std::vector<OutputFile>& order_only_deps);
+
const Settings* settings_; // Non-owning.
const Target* target_; // Non-owning.
- const Toolchain* toolchain_; // Non-owning.
std::ostream& out_;
PathOutput path_output_;
- NinjaHelper helper_;
-
private:
void WriteCopyRules();

Powered by Google App Engine
This is Rietveld 408576698