Revert 264226 "Reduce dependency of TiclInvalidationService on P..."
[chromium-blink-merge.git] / tools / gn / ninja_toolchain_writer.h
blobff0ebc0fffd8e0803e6f1f58827077906dcf34af
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.
5 #ifndef TOOLS_GN_NINJA_TOOLCHAIN_WRITER_H_
6 #define TOOLS_GN_NINJA_TOOLCHAIN_WRITER_H_
8 #include <iosfwd>
9 #include <set>
10 #include <string>
11 #include <vector>
13 #include "tools/gn/ninja_helper.h"
14 #include "tools/gn/path_output.h"
16 class BuildSettings;
17 class Settings;
18 class Target;
19 class Toolchain;
21 class NinjaToolchainWriter {
22 public:
23 // Takes the settings for the toolchain, as well as the list of all targets
24 // assicoated with the toolchain.
25 static bool RunAndWriteFile(const Settings* settings,
26 const Toolchain* toolchain,
27 const std::vector<const Target*>& targets);
29 private:
30 NinjaToolchainWriter(const Settings* settings,
31 const Toolchain* toolchain,
32 const std::vector<const Target*>& targets,
33 std::ostream& out);
34 ~NinjaToolchainWriter();
36 void Run();
38 void WriteRules();
39 void WriteSubninjas();
41 const Settings* settings_;
42 const Toolchain* toolchain_;
43 std::vector<const Target*> targets_;
44 std::ostream& out_;
45 PathOutput path_output_;
47 NinjaHelper helper_;
49 DISALLOW_COPY_AND_ASSIGN(NinjaToolchainWriter);
52 #endif // TOOLS_GN_NINJA_TOOLCHAIN_WRITER_H_