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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 std::string deps; | 63 std::string deps; |
64 std::string description; | 64 std::string description; |
65 std::string lib_dir_prefix; | 65 std::string lib_dir_prefix; |
66 std::string lib_prefix; | 66 std::string lib_prefix; |
67 std::string pool; | 67 std::string pool; |
68 std::string restat; | 68 std::string restat; |
69 std::string rspfile; | 69 std::string rspfile; |
70 std::string rspfile_content; | 70 std::string rspfile_content; |
71 }; | 71 }; |
72 | 72 |
73 Toolchain(const Label& label); | 73 Toolchain(const Settings* settings, const Label& label); |
74 virtual ~Toolchain(); | 74 virtual ~Toolchain(); |
75 | 75 |
76 // Item overrides. | 76 // Item overrides. |
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 const std::string& environment() const { return environment_; } | 87 const std::string& environment() const { return environment_; } |
88 void set_environment(const std::string& env) { environment_ = env; } | 88 void set_environment(const std::string& env) { environment_ = env; } |
89 | 89 |
90 bool is_default() const { return is_default_; } | |
91 void set_is_default(bool id) { is_default_ = id; } | |
92 | |
93 // Specifies build argument overrides that will be set on the base scope. It | 90 // Specifies build argument overrides that will be set on the base scope. It |
94 // will be as if these arguments were passed in on the command line. This | 91 // will be as if these arguments were passed in on the command line. This |
95 // allows a toolchain to override the OS type of the default toolchain or | 92 // allows a toolchain to override the OS type of the default toolchain or |
96 // pass in other settings. | 93 // pass in other settings. |
97 Scope::KeyValueMap& args() { return args_; } | 94 Scope::KeyValueMap& args() { return args_; } |
98 const Scope::KeyValueMap& args() const { return args_; } | 95 const Scope::KeyValueMap& args() const { return args_; } |
99 | 96 |
100 private: | 97 private: |
101 Tool tools_[TYPE_NUMTYPES]; | 98 Tool tools_[TYPE_NUMTYPES]; |
102 | 99 |
103 bool is_default_; | |
104 Scope::KeyValueMap args_; | 100 Scope::KeyValueMap args_; |
105 | 101 |
106 std::string environment_; | 102 std::string environment_; |
107 }; | 103 }; |
108 | 104 |
109 #endif // TOOLS_GN_TOOLCHAIN_H_ | 105 #endif // TOOLS_GN_TOOLCHAIN_H_ |
OLD | NEW |