| 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_TOOLCHAIN_WRITER_H_ | 5 #ifndef TOOLS_GN_NINJA_TOOLCHAIN_WRITER_H_ |
| 6 #define TOOLS_GN_NINJA_TOOLCHAIN_WRITER_H_ | 6 #define TOOLS_GN_NINJA_TOOLCHAIN_WRITER_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "tools/gn/ninja_helper.h" | 13 #include "tools/gn/ninja_helper.h" |
| 14 #include "tools/gn/path_output.h" | 14 #include "tools/gn/path_output.h" |
| 15 | 15 |
| 16 class BuildSettings; | 16 class BuildSettings; |
| 17 class Settings; | 17 class Settings; |
| 18 class Target; | 18 class Target; |
| 19 class Toolchain; |
| 19 | 20 |
| 20 class NinjaToolchainWriter { | 21 class NinjaToolchainWriter { |
| 21 public: | 22 public: |
| 22 // Takes the settings for the toolchain, as well as the list of all targets | 23 // Takes the settings for the toolchain, as well as the list of all targets |
| 23 // assicoated with the toolchain. Ninja files exactly matching "skip_files" | 24 // assicoated with the toolchain. |
| 24 // will not be included in the subninja list. | |
| 25 static bool RunAndWriteFile(const Settings* settings, | 25 static bool RunAndWriteFile(const Settings* settings, |
| 26 const std::vector<const Target*>& targets, | 26 const Toolchain* toolchain, |
| 27 const std::set<std::string>& skip_files); | 27 const std::vector<const Target*>& targets); |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 NinjaToolchainWriter(const Settings* settings, | 30 NinjaToolchainWriter(const Settings* settings, |
| 31 const Toolchain* toolchain, |
| 31 const std::vector<const Target*>& targets, | 32 const std::vector<const Target*>& targets, |
| 32 const std::set<std::string>& skip_files, | |
| 33 std::ostream& out); | 33 std::ostream& out); |
| 34 ~NinjaToolchainWriter(); | 34 ~NinjaToolchainWriter(); |
| 35 | 35 |
| 36 void Run(); | 36 void Run(); |
| 37 | 37 |
| 38 void WriteRules(); | 38 void WriteRules(); |
| 39 void WriteSubninjas(); | 39 void WriteSubninjas(); |
| 40 | 40 |
| 41 const Settings* settings_; | 41 const Settings* settings_; |
| 42 const Toolchain* toolchain_; |
| 42 std::vector<const Target*> targets_; | 43 std::vector<const Target*> targets_; |
| 43 const std::set<std::string>& skip_files_; | |
| 44 std::ostream& out_; | 44 std::ostream& out_; |
| 45 PathOutput path_output_; | 45 PathOutput path_output_; |
| 46 | 46 |
| 47 NinjaHelper helper_; | 47 NinjaHelper helper_; |
| 48 | 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(NinjaToolchainWriter); | 49 DISALLOW_COPY_AND_ASSIGN(NinjaToolchainWriter); |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 #endif // TOOLS_GN_NINJA_TOOLCHAIN_WRITER_H_ | 52 #endif // TOOLS_GN_NINJA_TOOLCHAIN_WRITER_H_ |
| OLD | NEW |