summaryrefslogtreecommitdiffstats
path: root/tools/gn/gyp_target_writer.h
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-22 22:09:55 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-22 22:09:55 +0000
commit05b94b4340501afbc32619c5b10a1d7c533670cd (patch)
tree1e6d8dc92f528514b445f950f35d3a0d833cfbee /tools/gn/gyp_target_writer.h
parentbd71e95c4cd64660daf4e00be2a66cd96a022a2c (diff)
downloadchromium_src-05b94b4340501afbc32619c5b10a1d7c533670cd.zip
chromium_src-05b94b4340501afbc32619c5b10a1d7c533670cd.tar.gz
chromium_src-05b94b4340501afbc32619c5b10a1d7c533670cd.tar.bz2
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
Diffstat (limited to 'tools/gn/gyp_target_writer.h')
-rw-r--r--tools/gn/gyp_target_writer.h13
1 files changed, 12 insertions, 1 deletions
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);