OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef TOOLS_GN_NINJA_TARGET_WRITER_H_ | 5 #ifndef TOOLS_GN_NINJA_TARGET_WRITER_H_ |
6 #define TOOLS_GN_NINJA_TARGET_WRITER_H_ | 6 #define TOOLS_GN_NINJA_TARGET_WRITER_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 static void RunAndWriteFile(const Target* target, const Toolchain* toolchain); | 27 static void RunAndWriteFile(const Target* target, const Toolchain* toolchain); |
28 | 28 |
29 virtual void Run() = 0; | 29 virtual void Run() = 0; |
30 | 30 |
31 protected: | 31 protected: |
32 // Writes to the output stream a stamp rule for input dependencies, and | 32 // Writes to the output stream a stamp rule for input dependencies, and |
33 // returns the string to be appended to source rules that encodes the | 33 // returns the string to be appended to source rules that encodes the |
34 // order-only dependencies for the current target. This will include the "|" | 34 // order-only dependencies for the current target. This will include the "|" |
35 // character so can just be appended to the source rules. If there are no | 35 // character so can just be appended to the source rules. If there are no |
36 // implicit dependencies, returns the empty string. | 36 // implicit dependencies and no extra target dependencies passed in, returns |
37 std::string WriteInputDepsStampAndGetDep() const; | 37 // the empty string. |
| 38 std::string WriteInputDepsStampAndGetDep( |
| 39 const std::vector<const Target*>& extra_hard_deps) const; |
38 | 40 |
39 // Returns the FileTemplate constructed from the outputs variable. This is | 41 // Returns the FileTemplate constructed from the outputs variable. This is |
40 // like FileTemplate::GetForTargetOutputs except this additionally trims the | 42 // like FileTemplate::GetForTargetOutputs except this additionally trims the |
41 // build directory from the front so we can just write the names without | 43 // build directory from the front so we can just write the names without |
42 // further processing. | 44 // further processing. |
43 FileTemplate GetOutputTemplate() const; | 45 FileTemplate GetOutputTemplate() const; |
44 | 46 |
45 const Settings* settings_; // Non-owning. | 47 const Settings* settings_; // Non-owning. |
46 const Target* target_; // Non-owning. | 48 const Target* target_; // Non-owning. |
47 const Toolchain* toolchain_; // Non-owning. | 49 const Toolchain* toolchain_; // Non-owning. |
48 std::ostream& out_; | 50 std::ostream& out_; |
49 PathOutput path_output_; | 51 PathOutput path_output_; |
50 | 52 |
51 NinjaHelper helper_; | 53 NinjaHelper helper_; |
52 | 54 |
53 private: | 55 private: |
54 void WriteCopyRules(); | 56 void WriteCopyRules(); |
55 | 57 |
56 DISALLOW_COPY_AND_ASSIGN(NinjaTargetWriter); | 58 DISALLOW_COPY_AND_ASSIGN(NinjaTargetWriter); |
57 }; | 59 }; |
58 | 60 |
59 #endif // TOOLS_GN_NINJA_TARGET_WRITER_H_ | 61 #endif // TOOLS_GN_NINJA_TARGET_WRITER_H_ |
OLD | NEW |