| 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" |
| 11 #include "tools/gn/label_ptr.h" |
| 11 #include "tools/gn/scope.h" | 12 #include "tools/gn/scope.h" |
| 12 #include "tools/gn/value.h" | 13 #include "tools/gn/value.h" |
| 13 | 14 |
| 14 // Holds information on a specific toolchain. This data is filled in when we | 15 // Holds information on a specific toolchain. This data is filled in when we |
| 15 // encounter a toolchain definition. | 16 // encounter a toolchain definition. |
| 16 // | 17 // |
| 17 // This class is an Item so it can participate in dependency management. In | 18 // This class is an Item so it can participate in dependency management. In |
| 18 // particular, when a target uses a toolchain, it should have a dependency on | 19 // particular, when a target uses a toolchain, it should have a dependency on |
| 19 // that toolchain's object so that we can be sure we loaded the toolchain | 20 // that toolchain's object so that we can be sure we loaded the toolchain |
| 20 // before generating the build for that target. | 21 // before generating the build for that target. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 virtual Toolchain* AsToolchain() OVERRIDE; | 78 virtual Toolchain* AsToolchain() OVERRIDE; |
| 78 virtual const Toolchain* AsToolchain() const OVERRIDE; | 79 virtual const Toolchain* AsToolchain() const OVERRIDE; |
| 79 | 80 |
| 80 // Returns TYPE_NONE on failure. | 81 // Returns TYPE_NONE on failure. |
| 81 static ToolType ToolNameToType(const base::StringPiece& str); | 82 static ToolType ToolNameToType(const base::StringPiece& str); |
| 82 static std::string ToolTypeToName(ToolType type); | 83 static std::string ToolTypeToName(ToolType type); |
| 83 | 84 |
| 84 const Tool& GetTool(ToolType type) const; | 85 const Tool& GetTool(ToolType type) const; |
| 85 void SetTool(ToolType type, const Tool& t); | 86 void SetTool(ToolType type, const Tool& t); |
| 86 | 87 |
| 88 // Targets that must be resolved before compiling any targets. |
| 89 const LabelTargetVector& deps() const { return deps_; } |
| 90 LabelTargetVector& deps() { return deps_; } |
| 91 |
| 87 // Specifies build argument overrides that will be set on the base scope. It | 92 // Specifies build argument overrides that will be set on the base scope. It |
| 88 // will be as if these arguments were passed in on the command line. This | 93 // will be as if these arguments were passed in on the command line. This |
| 89 // allows a toolchain to override the OS type of the default toolchain or | 94 // allows a toolchain to override the OS type of the default toolchain or |
| 90 // pass in other settings. | 95 // pass in other settings. |
| 91 Scope::KeyValueMap& args() { return args_; } | 96 Scope::KeyValueMap& args() { return args_; } |
| 92 const Scope::KeyValueMap& args() const { return args_; } | 97 const Scope::KeyValueMap& args() const { return args_; } |
| 93 | 98 |
| 94 private: | 99 private: |
| 95 Tool tools_[TYPE_NUMTYPES]; | 100 Tool tools_[TYPE_NUMTYPES]; |
| 96 | 101 |
| 102 LabelTargetVector deps_; |
| 97 Scope::KeyValueMap args_; | 103 Scope::KeyValueMap args_; |
| 98 }; | 104 }; |
| 99 | 105 |
| 100 #endif // TOOLS_GN_TOOLCHAIN_H_ | 106 #endif // TOOLS_GN_TOOLCHAIN_H_ |
| OLD | NEW |