OLD | NEW |
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_TOOLCHAIN_H_ | 5 #ifndef TOOLS_GN_TOOLCHAIN_H_ |
6 #define TOOLS_GN_TOOLCHAIN_H_ | 6 #define TOOLS_GN_TOOLCHAIN_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/strings/string_piece.h" | 9 #include "base/strings/string_piece.h" |
10 #include "tools/gn/item.h" | 10 #include "tools/gn/item.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 virtual Toolchain* AsToolchain() OVERRIDE; | 77 virtual Toolchain* AsToolchain() OVERRIDE; |
78 virtual const Toolchain* AsToolchain() const OVERRIDE; | 78 virtual const Toolchain* AsToolchain() const OVERRIDE; |
79 | 79 |
80 // Returns TYPE_NONE on failure. | 80 // Returns TYPE_NONE on failure. |
81 static ToolType ToolNameToType(const base::StringPiece& str); | 81 static ToolType ToolNameToType(const base::StringPiece& str); |
82 static std::string ToolTypeToName(ToolType type); | 82 static std::string ToolTypeToName(ToolType type); |
83 | 83 |
84 const Tool& GetTool(ToolType type) const; | 84 const Tool& GetTool(ToolType type) const; |
85 void SetTool(ToolType type, const Tool& t); | 85 void SetTool(ToolType type, const Tool& t); |
86 | 86 |
87 // This extra stuff is specified by the build and will be added to the top | |
88 // of a generated GYP file (right after the opening "{"). | |
89 std::string gyp_header() const { return gyp_header_; } | |
90 void set_gyp_header(const std::string& gh) { gyp_header_ = gh; } | |
91 | |
92 // Specifies build argument overrides that will be set on the base scope. It | 87 // Specifies build argument overrides that will be set on the base scope. It |
93 // will be as if these arguments were passed in on the command line. This | 88 // will be as if these arguments were passed in on the command line. This |
94 // allows a toolchain to override the OS type of the default toolchain or | 89 // allows a toolchain to override the OS type of the default toolchain or |
95 // pass in other settings. | 90 // pass in other settings. |
96 Scope::KeyValueMap& args() { return args_; } | 91 Scope::KeyValueMap& args() { return args_; } |
97 const Scope::KeyValueMap& args() const { return args_; } | 92 const Scope::KeyValueMap& args() const { return args_; } |
98 | 93 |
99 private: | 94 private: |
100 Tool tools_[TYPE_NUMTYPES]; | 95 Tool tools_[TYPE_NUMTYPES]; |
101 | 96 |
102 Scope::KeyValueMap args_; | 97 Scope::KeyValueMap args_; |
103 | |
104 std::string gyp_header_; | |
105 }; | 98 }; |
106 | 99 |
107 #endif // TOOLS_GN_TOOLCHAIN_H_ | 100 #endif // TOOLS_GN_TOOLCHAIN_H_ |
OLD | NEW |