From 05b94b4340501afbc32619c5b10a1d7c533670cd Mon Sep 17 00:00:00 2001 From: "brettw@chromium.org" Date: Fri, 22 Nov 2013 22:09:55 +0000 Subject: This writes a generator for GYP actions to run Ninja for script targets. This does not yet include the code that actually writes the corresponding ninja files. The GYP code also needed some output directory generation code, so this was consolidated in filesystem_utils and referenced from the existing place. BUG=322244 R=scottmg@chromium.org Review URL: https://codereview.chromium.org/80463004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236837 0039d316-1c4b-4281-b951-d872f2087c98 --- tools/gn/gyp_target_writer.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'tools/gn/gyp_target_writer.h') diff --git a/tools/gn/gyp_target_writer.h b/tools/gn/gyp_target_writer.h index 597a609..df44dab 100644 --- a/tools/gn/gyp_target_writer.h +++ b/tools/gn/gyp_target_writer.h @@ -10,6 +10,7 @@ #include "base/basictypes.h" #include "tools/gn/gyp_helper.h" +#include "tools/gn/path_output.h" class BuilderRecord; class Err; @@ -32,7 +33,9 @@ class GypTargetWriter { const BuilderRecord* host_release; }; - GypTargetWriter(const Target* target, std::ostream& out); + GypTargetWriter(const Target* target, + const SourceDir& gyp_dir, + std::ostream& out); virtual ~GypTargetWriter(); static void WriteFile(const SourceFile& gyp_file, @@ -42,11 +45,19 @@ class GypTargetWriter { virtual void Run() = 0; protected: + // Writes the given number of spaces to the output stream and returns it. + std::ostream& Indent(int spaces); + static std::ostream& Indent(std::ostream& out, int spaces); + + static const int kExtraIndent = 2; + const Settings* settings_; // Non-owning. const Target* target_; // Non-owning. + SourceDir gyp_dir_; // Dir of GYP file. std::ostream& out_; GypHelper helper_; + PathOutput path_output_; private: DISALLOW_COPY_AND_ASSIGN(GypTargetWriter); -- cgit v1.1