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_BUILD_WRITER_H_ | 5 #ifndef TOOLS_GN_NINJA_BUILD_WRITER_H_ |
6 #define TOOLS_GN_NINJA_BUILD_WRITER_H_ | 6 #define TOOLS_GN_NINJA_BUILD_WRITER_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 #include <set> |
9 #include <vector> | 10 #include <vector> |
10 | 11 |
11 #include "tools/gn/path_output.h" | 12 #include "tools/gn/path_output.h" |
12 | 13 |
13 class BuildSettings; | 14 class BuildSettings; |
14 class Err; | 15 class Err; |
15 class Settings; | 16 class Settings; |
16 class Target; | 17 class Target; |
17 class Toolchain; | 18 class Toolchain; |
18 | 19 |
(...skipping 18 matching lines...) Expand all Loading... |
37 std::ostream& dep_out); | 38 std::ostream& dep_out); |
38 ~NinjaBuildWriter(); | 39 ~NinjaBuildWriter(); |
39 | 40 |
40 bool Run(Err* err); | 41 bool Run(Err* err); |
41 | 42 |
42 void WriteNinjaRules(); | 43 void WriteNinjaRules(); |
43 void WriteLinkPool(); | 44 void WriteLinkPool(); |
44 void WriteSubninjas(); | 45 void WriteSubninjas(); |
45 bool WritePhonyAndAllRules(Err* err); | 46 bool WritePhonyAndAllRules(Err* err); |
46 | 47 |
47 void WritePhonyRule(const Target* target, const OutputFile& target_file, | 48 // Writes a phony rule for the given target with the given name. Adds the new |
48 const std::string& phony_name); | 49 // name to the given set. If the name is already in the set, does nothing. |
| 50 void WritePhonyRule(const Target* target, |
| 51 const OutputFile& target_file, |
| 52 const std::string& phony_name, |
| 53 std::set<std::string>* written_rules); |
49 | 54 |
50 const BuildSettings* build_settings_; | 55 const BuildSettings* build_settings_; |
51 std::vector<const Settings*> all_settings_; | 56 std::vector<const Settings*> all_settings_; |
52 const Toolchain* default_toolchain_; | 57 const Toolchain* default_toolchain_; |
53 std::vector<const Target*> default_toolchain_targets_; | 58 std::vector<const Target*> default_toolchain_targets_; |
54 std::ostream& out_; | 59 std::ostream& out_; |
55 std::ostream& dep_out_; | 60 std::ostream& dep_out_; |
56 PathOutput path_output_; | 61 PathOutput path_output_; |
57 | 62 |
58 DISALLOW_COPY_AND_ASSIGN(NinjaBuildWriter); | 63 DISALLOW_COPY_AND_ASSIGN(NinjaBuildWriter); |
59 }; | 64 }; |
60 | 65 |
61 #endif // TOOLS_GN_NINJA_BUILD_WRITER_H_ | 66 #endif // TOOLS_GN_NINJA_BUILD_WRITER_H_ |
62 | 67 |
OLD | NEW |