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_LABEL_H_ | 5 #ifndef TOOLS_GN_LABEL_H_ |
6 #define TOOLS_GN_LABEL_H_ | 6 #define TOOLS_GN_LABEL_H_ |
7 | 7 |
8 #include "base/containers/hash_tables.h" | 8 #include "base/containers/hash_tables.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "tools/gn/source_dir.h" | 10 #include "tools/gn/source_dir.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 // Makes a label with an empty toolchain. | 29 // Makes a label with an empty toolchain. |
30 Label(const SourceDir& dir, const base::StringPiece& name); | 30 Label(const SourceDir& dir, const base::StringPiece& name); |
31 ~Label(); | 31 ~Label(); |
32 | 32 |
33 // Resolives a string from a build file that may be relative to the | 33 // Resolives a string from a build file that may be relative to the |
34 // current directory into a fully qualified label. On failure returns an | 34 // current directory into a fully qualified label. On failure returns an |
35 // is_null() label and sets the error. | 35 // is_null() label and sets the error. |
36 static Label Resolve(const SourceDir& current_dir, | 36 static Label Resolve(const SourceDir& current_dir, |
37 const Label& current_toolchain, | 37 const Label& current_toolchain, |
38 const Value& input, | 38 const Value& input, |
| 39 const base::FilePath& source_root, |
39 Err* err); | 40 Err* err); |
40 | 41 |
41 bool is_null() const { return dir_.is_null(); } | 42 bool is_null() const { return dir_.is_null(); } |
42 | 43 |
43 const SourceDir& dir() const { return dir_; } | 44 const SourceDir& dir() const { return dir_; } |
44 const std::string& name() const { return name_; } | 45 const std::string& name() const { return name_; } |
45 | 46 |
46 const SourceDir& toolchain_dir() const { return toolchain_dir_; } | 47 const SourceDir& toolchain_dir() const { return toolchain_dir_; } |
47 const std::string& toolchain_name() const { return toolchain_name_; } | 48 const std::string& toolchain_name() const { return toolchain_name_; } |
48 | 49 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 } | 127 } |
127 #endif // COMPILER... | 128 #endif // COMPILER... |
128 | 129 |
129 } // namespace BASE_HASH_NAMESPACE | 130 } // namespace BASE_HASH_NAMESPACE |
130 | 131 |
131 inline void swap(Label& lhs, Label& rhs) { | 132 inline void swap(Label& lhs, Label& rhs) { |
132 lhs.swap(rhs); | 133 lhs.swap(rhs); |
133 } | 134 } |
134 | 135 |
135 #endif // TOOLS_GN_LABEL_H_ | 136 #endif // TOOLS_GN_LABEL_H_ |
OLD | NEW |