| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/err.h" | 5 #include "tools/gn/err.h" |
| 6 #include "tools/gn/filesystem_utils.h" | 6 #include "tools/gn/filesystem_utils.h" |
| 7 #include "tools/gn/functions.h" | 7 #include "tools/gn/functions.h" |
| 8 #include "tools/gn/label.h" | 8 #include "tools/gn/label.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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 "toolchain" | 65 "toolchain" |
| 66 The label of the toolchain. This will match the value of the | 66 The label of the toolchain. This will match the value of the |
| 67 "current_toolchain" variable when inside that target's declaration. | 67 "current_toolchain" variable when inside that target's declaration. |
| 68 | 68 |
| 69 Examples | 69 Examples |
| 70 | 70 |
| 71 get_label_info(":foo", "name") | 71 get_label_info(":foo", "name") |
| 72 # Returns string "foo". | 72 # Returns string "foo". |
| 73 | 73 |
| 74 get_label_info("//foo/bar:baz", "gen_dir") | 74 get_label_info("//foo/bar:baz", "target_gen_dir") |
| 75 # Returns string "//out/Debug/gen/foo/bar". | 75 # Returns string "//out/Debug/gen/foo/bar". |
| 76 )*"; | 76 )*"; |
| 77 | 77 |
| 78 Value RunGetLabelInfo(Scope* scope, | 78 Value RunGetLabelInfo(Scope* scope, |
| 79 const FunctionCallNode* function, | 79 const FunctionCallNode* function, |
| 80 const std::vector<Value>& args, | 80 const std::vector<Value>& args, |
| 81 Err* err) { | 81 Err* err) { |
| 82 if (args.size() != 2) { | 82 if (args.size() != 2) { |
| 83 *err = Err(function, "Expected two arguments."); | 83 *err = Err(function, "Expected two arguments."); |
| 84 return Value(); | 84 return Value(); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 135 |
| 136 } else { | 136 } else { |
| 137 *err = Err(args[1], "Unknown value for \"what\" parameter."); | 137 *err = Err(args[1], "Unknown value for \"what\" parameter."); |
| 138 return Value(); | 138 return Value(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 return result; | 141 return result; |
| 142 } | 142 } |
| 143 | 143 |
| 144 } // namespace functions | 144 } // namespace functions |
| OLD | NEW |