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

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

Issue 440333002: Support more configurability in GN toolchains (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: unsigned check Created 6 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 | Annotate | Revision Log
« no previous file with comments | « tools/gn/ninja_target_writer_unittest.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 "tools/gn/ninja_helper.h" 13 #include "base/gtest_prod_util.h"
14 #include "tools/gn/path_output.h" 14 #include "tools/gn/path_output.h"
15 #include "tools/gn/toolchain.h"
15 16
16 class BuildSettings; 17 class BuildSettings;
18 struct EscapeOptions;
17 class Settings; 19 class Settings;
18 class Target; 20 class Target;
19 class Toolchain; 21 class Tool;
20 22
21 class NinjaToolchainWriter { 23 class NinjaToolchainWriter {
22 public: 24 public:
23 // Takes the settings for the toolchain, as well as the list of all targets 25 // Takes the settings for the toolchain, as well as the list of all targets
24 // associated with the toolchain. 26 // associated with the toolchain.
25 static bool RunAndWriteFile(const Settings* settings, 27 static bool RunAndWriteFile(const Settings* settings,
26 const Toolchain* toolchain, 28 const Toolchain* toolchain,
27 const std::vector<const Target*>& targets); 29 const std::vector<const Target*>& targets);
28 30
29 private: 31 private:
32 FRIEND_TEST_ALL_PREFIXES(NinjaToolchainWriter, WriteToolRule);
33
30 NinjaToolchainWriter(const Settings* settings, 34 NinjaToolchainWriter(const Settings* settings,
31 const Toolchain* toolchain, 35 const Toolchain* toolchain,
32 const std::vector<const Target*>& targets, 36 const std::vector<const Target*>& targets,
33 std::ostream& out); 37 std::ostream& out);
34 ~NinjaToolchainWriter(); 38 ~NinjaToolchainWriter();
35 39
36 void Run(); 40 void Run();
37 41
38 void WriteRules(); 42 void WriteRules();
43 void WriteToolRule(Toolchain::ToolType type,
44 const Tool* tool,
45 const std::string& rule_prefix);
46 void WriteRulePattern(const char* name,
47 const SubstitutionPattern& pattern,
48 const EscapeOptions& options);
39 void WriteSubninjas(); 49 void WriteSubninjas();
40 50
41 const Settings* settings_; 51 const Settings* settings_;
42 const Toolchain* toolchain_; 52 const Toolchain* toolchain_;
43 std::vector<const Target*> targets_; 53 std::vector<const Target*> targets_;
44 std::ostream& out_; 54 std::ostream& out_;
45 PathOutput path_output_; 55 PathOutput path_output_;
46 56
47 NinjaHelper helper_;
48
49 DISALLOW_COPY_AND_ASSIGN(NinjaToolchainWriter); 57 DISALLOW_COPY_AND_ASSIGN(NinjaToolchainWriter);
50 }; 58 };
51 59
52 #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_unittest.cc ('k') | tools/gn/ninja_toolchain_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698