Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(227)

Side by Side Diff: tools/gn/ninja_toolchain_writer.h

Issue 2152413002: GN: don't write separate files for non-binary targets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: typo Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/gn/ninja_target_writer.cc ('k') | tools/gn/ninja_toolchain_writer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/gtest_prod_util.h" 13 #include "base/gtest_prod_util.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "tools/gn/ninja_writer.h"
15 #include "tools/gn/path_output.h" 16 #include "tools/gn/path_output.h"
16 #include "tools/gn/toolchain.h" 17 #include "tools/gn/toolchain.h"
17 18
18 class BuildSettings; 19 class BuildSettings;
19 struct EscapeOptions; 20 struct EscapeOptions;
20 class Settings; 21 class Settings;
21 class Target; 22 class Target;
22 class Tool; 23 class Tool;
23 24
24 class NinjaToolchainWriter { 25 class NinjaToolchainWriter {
25 public: 26 public:
26 // Takes the settings for the toolchain, as well as the list of all targets 27 // Takes the settings for the toolchain, as well as the list of all targets
27 // associated with the toolchain. 28 // associated with the toolchain.
28 static bool RunAndWriteFile(const Settings* settings, 29 static bool RunAndWriteFile(
29 const Toolchain* toolchain, 30 const Settings* settings,
30 const std::vector<const Target*>& targets); 31 const Toolchain* toolchain,
32 const std::vector<NinjaWriter::TargetRulePair>& rules);
31 33
32 private: 34 private:
33 FRIEND_TEST_ALL_PREFIXES(NinjaToolchainWriter, WriteToolRule); 35 FRIEND_TEST_ALL_PREFIXES(NinjaToolchainWriter, WriteToolRule);
34 36
35 NinjaToolchainWriter(const Settings* settings, 37 NinjaToolchainWriter(const Settings* settings,
36 const Toolchain* toolchain, 38 const Toolchain* toolchain,
37 const std::vector<const Target*>& targets,
38 std::ostream& out); 39 std::ostream& out);
39 ~NinjaToolchainWriter(); 40 ~NinjaToolchainWriter();
40 41
41 void Run(); 42 void Run(const std::vector<NinjaWriter::TargetRulePair>& extra_rules);
42 43
43 void WriteRules(); 44 void WriteRules();
44 void WriteToolRule(Toolchain::ToolType type, 45 void WriteToolRule(Toolchain::ToolType type,
45 const Tool* tool, 46 const Tool* tool,
46 const std::string& rule_prefix); 47 const std::string& rule_prefix);
47 void WriteRulePattern(const char* name, 48 void WriteRulePattern(const char* name,
48 const SubstitutionPattern& pattern, 49 const SubstitutionPattern& pattern,
49 const EscapeOptions& options); 50 const EscapeOptions& options);
50 void WriteSubninjas();
51 51
52 const Settings* settings_; 52 const Settings* settings_;
53 const Toolchain* toolchain_; 53 const Toolchain* toolchain_;
54 std::vector<const Target*> targets_;
55 std::ostream& out_; 54 std::ostream& out_;
56 PathOutput path_output_; 55 PathOutput path_output_;
57 56
58 DISALLOW_COPY_AND_ASSIGN(NinjaToolchainWriter); 57 DISALLOW_COPY_AND_ASSIGN(NinjaToolchainWriter);
59 }; 58 };
60 59
61 #endif // TOOLS_GN_NINJA_TOOLCHAIN_WRITER_H_ 60 #endif // TOOLS_GN_NINJA_TOOLCHAIN_WRITER_H_
OLDNEW
« no previous file with comments | « tools/gn/ninja_target_writer.cc ('k') | tools/gn/ninja_toolchain_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698