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 #include "tools/gn/label.h" | 5 #include "tools/gn/label.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "tools/gn/err.h" | 8 #include "tools/gn/err.h" |
9 #include "tools/gn/parse_tree.h" | 9 #include "tools/gn/parse_tree.h" |
10 #include "tools/gn/value.h" | 10 #include "tools/gn/value.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 // Given the separate-out input (everything before the colon) in the dep rule, | 23 // Given the separate-out input (everything before the colon) in the dep rule, |
24 // computes the final build rule. Sets err on failure. On success, | 24 // computes the final build rule. Sets err on failure. On success, |
25 // |*used_implicit| will be set to whether the implicit current directory was | 25 // |*used_implicit| will be set to whether the implicit current directory was |
26 // used. The value is used only for generating error messages. | 26 // used. The value is used only for generating error messages. |
27 bool ComputeBuildLocationFromDep(const Value& input_value, | 27 bool ComputeBuildLocationFromDep(const Value& input_value, |
28 const SourceDir& current_dir, | 28 const SourceDir& current_dir, |
29 const base::StringPiece& input, | 29 const base::StringPiece& input, |
30 SourceDir* result, | 30 SourceDir* result, |
31 Err* err) { | 31 Err* err) { |
32 // No rule, use the current locaton. | 32 // No rule, use the current location. |
33 if (input.empty()) { | 33 if (input.empty()) { |
34 *result = current_dir; | 34 *result = current_dir; |
35 return true; | 35 return true; |
36 } | 36 } |
37 | 37 |
38 *result = current_dir.ResolveRelativeDir(input); | 38 *result = current_dir.ResolveRelativeDir(input); |
39 return true; | 39 return true; |
40 } | 40 } |
41 | 41 |
42 // Given the separated-out target name (after the colon) computes the final | 42 // Given the separated-out target name (after the colon) computes the final |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 } | 253 } |
254 return ret; | 254 return ret; |
255 } | 255 } |
256 | 256 |
257 std::string Label::GetUserVisibleName(const Label& default_toolchain) const { | 257 std::string Label::GetUserVisibleName(const Label& default_toolchain) const { |
258 bool include_toolchain = | 258 bool include_toolchain = |
259 default_toolchain.dir() != toolchain_dir_ || | 259 default_toolchain.dir() != toolchain_dir_ || |
260 default_toolchain.name() != toolchain_name_; | 260 default_toolchain.name() != toolchain_name_; |
261 return GetUserVisibleName(include_toolchain); | 261 return GetUserVisibleName(include_toolchain); |
262 } | 262 } |
OLD | NEW |