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_WRITER_H_ | 5 #ifndef TOOLS_GN_NINJA_WRITER_H_ |
6 #define TOOLS_GN_NINJA_WRITER_H_ | 6 #define TOOLS_GN_NINJA_WRITER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 | 13 |
14 class Builder; | 14 class Builder; |
15 class BuildSettings; | 15 class BuildSettings; |
16 class Err; | 16 class Err; |
| 17 class Pool; |
17 class Settings; | 18 class Settings; |
18 class Target; | 19 class Target; |
19 | 20 |
20 class NinjaWriter { | 21 class NinjaWriter { |
21 public: | 22 public: |
22 // On failure will populate |err| and will return false. | 23 // On failure will populate |err| and will return false. |
23 static bool RunAndWriteFiles(const BuildSettings* build_settings, | 24 static bool RunAndWriteFiles(const BuildSettings* build_settings, |
24 Builder* builder, | 25 Builder* builder, |
25 Err* err); | 26 Err* err); |
26 | 27 |
27 // Writes only the toolchain.ninja files, skipping the root buildfile. The | 28 // Writes only the toolchain.ninja files, skipping the root buildfile. The |
28 // settings for the files written will be added to the vector. | 29 // settings for the files written will be added to the vector. |
29 static bool RunAndWriteToolchainFiles( | 30 static bool RunAndWriteToolchainFiles( |
30 const BuildSettings* build_settings, | 31 const BuildSettings* build_settings, |
31 Builder* builder, | 32 Builder* builder, |
32 std::vector<const Settings*>* all_settings, | 33 std::vector<const Settings*>* all_settings, |
33 Err* err); | 34 Err* err); |
34 | 35 |
35 private: | 36 private: |
36 NinjaWriter(const BuildSettings* build_settings, Builder* builder); | 37 NinjaWriter(const BuildSettings* build_settings, Builder* builder); |
37 ~NinjaWriter(); | 38 ~NinjaWriter(); |
38 | 39 |
39 bool WriteToolchains( | 40 bool WriteToolchains(std::vector<const Settings*>* all_settings, |
40 std::vector<const Settings*>* all_settings, | 41 std::vector<const Target*>* default_targets, |
41 std::vector<const Target*>* default_targets, | 42 std::vector<const Pool*>* all_pools, |
42 Err* err); | 43 Err* err); |
43 bool WriteRootBuildfiles(const std::vector<const Settings*>& all_settings, | 44 bool WriteRootBuildfiles(const std::vector<const Settings*>& all_settings, |
44 const std::vector<const Target*>& default_targets, | 45 const std::vector<const Target*>& default_targets, |
| 46 const std::vector<const Pool*>& all_pools, |
45 Err* err); | 47 Err* err); |
46 | 48 |
47 const BuildSettings* build_settings_; | 49 const BuildSettings* build_settings_; |
48 Builder* builder_; | 50 Builder* builder_; |
49 | 51 |
50 DISALLOW_COPY_AND_ASSIGN(NinjaWriter); | 52 DISALLOW_COPY_AND_ASSIGN(NinjaWriter); |
51 }; | 53 }; |
52 | 54 |
53 #endif // TOOLS_GN_NINJA_WRITER_H_ | 55 #endif // TOOLS_GN_NINJA_WRITER_H_ |
OLD | NEW |