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_
11 #include "tools/gn/ninja_helper.h"
12 #include "tools/gn/path_output.h"
18 // Generates the toplevel "build.ninja" file. This references the individual
19 // toolchain files and lists all input .gn files as dependencies of the
21 class NinjaBuildWriter
{
23 static bool RunAndWriteFile(
24 const BuildSettings
* settings
,
25 const std::vector
<const Settings
*>& all_settings
,
26 const std::vector
<const Target
*>& default_toolchain_targets
);
29 NinjaBuildWriter(const BuildSettings
* settings
,
30 const std::vector
<const Settings
*>& all_settings
,
31 const std::vector
<const Target
*>& default_toolchain_targets
,
33 std::ostream
& dep_out
);
38 void WriteNinjaRules();
39 void WriteSubninjas();
40 void WritePhonyAndAllRules();
42 const BuildSettings
* build_settings_
;
43 std::vector
<const Settings
*> all_settings_
;
44 std::vector
<const Target
*> default_toolchain_targets_
;
46 std::ostream
& dep_out_
;
47 PathOutput path_output_
;
51 DISALLOW_COPY_AND_ASSIGN(NinjaBuildWriter
);
54 #endif // TOOLS_GN_NINJA_BUILD_GENERATOR_H_