OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef TOOLS_GN_GYP_TARGET_WRITER_H_ |
| 6 #define TOOLS_GN_GYP_TARGET_WRITER_H_ |
| 7 |
| 8 #include <iosfwd> |
| 9 #include <vector> |
| 10 |
| 11 #include "base/basictypes.h" |
| 12 #include "tools/gn/gyp_helper.h" |
| 13 |
| 14 class Err; |
| 15 class Settings; |
| 16 class SourceFile; |
| 17 class Target; |
| 18 |
| 19 class GypTargetWriter { |
| 20 public: |
| 21 struct TargetPair { |
| 22 TargetPair() : debug(NULL), release(NULL) {} |
| 23 const Target* debug; |
| 24 const Target* release; |
| 25 }; |
| 26 |
| 27 GypTargetWriter(const Target* target, std::ostream& out); |
| 28 virtual ~GypTargetWriter(); |
| 29 |
| 30 static void WriteFile(const SourceFile& gyp_file, |
| 31 const std::vector<TargetPair>& targets, |
| 32 Err* err); |
| 33 |
| 34 virtual void Run() = 0; |
| 35 |
| 36 protected: |
| 37 const Settings* settings_; // Non-owning. |
| 38 const Target* target_; // Non-owning. |
| 39 std::ostream& out_; |
| 40 |
| 41 GypHelper helper_; |
| 42 |
| 43 private: |
| 44 DISALLOW_COPY_AND_ASSIGN(GypTargetWriter); |
| 45 }; |
| 46 |
| 47 #endif // TOOLS_GN_GYP_TARGET_WRITER_H_ |
OLD | NEW |