Add Media Router Action stub implementation.
[chromium-blink-merge.git] / tools / gn / ninja_build_writer.h
blob6f7bf3813a7090025602230191a38da6787e9b9a
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_BUILD_WRITER_H_
6 #define TOOLS_GN_NINJA_BUILD_WRITER_H_
8 #include <iosfwd>
9 #include <vector>
11 #include "tools/gn/path_output.h"
13 class BuildSettings;
14 class Err;
15 class Settings;
16 class Target;
17 class Toolchain;
19 // Generates the toplevel "build.ninja" file. This references the individual
20 // toolchain files and lists all input .gn files as dependencies of the
21 // build itself.
22 class NinjaBuildWriter {
23 public:
24 static bool RunAndWriteFile(
25 const BuildSettings* settings,
26 const std::vector<const Settings*>& all_settings,
27 const Toolchain* default_toolchain,
28 const std::vector<const Target*>& default_toolchain_targets,
29 Err* err);
31 private:
32 NinjaBuildWriter(const BuildSettings* settings,
33 const std::vector<const Settings*>& all_settings,
34 const Toolchain* default_toolchain,
35 const std::vector<const Target*>& default_toolchain_targets,
36 std::ostream& out,
37 std::ostream& dep_out);
38 ~NinjaBuildWriter();
40 bool Run(Err* err);
42 void WriteNinjaRules();
43 void WriteLinkPool();
44 void WriteSubninjas();
45 bool WritePhonyAndAllRules(Err* err);
47 void WritePhonyRule(const Target* target, const OutputFile& target_file,
48 const std::string& phony_name);
50 const BuildSettings* build_settings_;
51 std::vector<const Settings*> all_settings_;
52 const Toolchain* default_toolchain_;
53 std::vector<const Target*> default_toolchain_targets_;
54 std::ostream& out_;
55 std::ostream& dep_out_;
56 PathOutput path_output_;
58 DISALLOW_COPY_AND_ASSIGN(NinjaBuildWriter);
61 #endif // TOOLS_GN_NINJA_BUILD_WRITER_H_