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/functions.h" | 5 #include "tools/gn/functions.h" |
6 | 6 |
7 #include "tools/gn/config_values_generator.h" | 7 #include "tools/gn/config_values_generator.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/scope.h" | 10 #include "tools/gn/scope.h" |
11 #include "tools/gn/target_generator.h" | 11 #include "tools/gn/target_generator.h" |
12 #include "tools/gn/template.h" | 12 #include "tools/gn/template.h" |
13 #include "tools/gn/value.h" | 13 #include "tools/gn/value.h" |
14 #include "tools/gn/variables.h" | 14 #include "tools/gn/variables.h" |
15 | 15 |
16 #define DEPENDENT_CONFIG_VARS \ | 16 #define DEPENDENT_CONFIG_VARS \ |
17 " Dependent configs: all_dependent_configs, public_configs\n" | 17 " Dependent configs: all_dependent_configs, public_configs\n" |
18 #define DEPS_VARS \ | 18 #define DEPS_VARS \ |
19 " Deps: data_deps, deps, forward_dependent_configs_from, public_deps\n" | 19 " Deps: data_deps, deps, public_deps\n" |
20 #define GENERAL_TARGET_VARS \ | 20 #define GENERAL_TARGET_VARS \ |
21 " General: check_includes, configs, data, inputs, output_name,\n" \ | 21 " General: check_includes, configs, data, inputs, output_name,\n" \ |
22 " output_extension, public, sources, testonly, visibility\n" | 22 " output_extension, public, sources, testonly, visibility\n" |
23 | 23 |
24 namespace functions { | 24 namespace functions { |
25 | 25 |
26 namespace { | 26 namespace { |
27 | 27 |
28 Value ExecuteGenericTarget(const char* target_type, | 28 Value ExecuteGenericTarget(const char* target_type, |
29 Scope* scope, | 29 Scope* scope, |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 const char kGroup_HelpShort[] = | 323 const char kGroup_HelpShort[] = |
324 "group: Declare a named group of targets."; | 324 "group: Declare a named group of targets."; |
325 const char kGroup_Help[] = | 325 const char kGroup_Help[] = |
326 "group: Declare a named group of targets.\n" | 326 "group: Declare a named group of targets.\n" |
327 "\n" | 327 "\n" |
328 " This target type allows you to create meta-targets that just collect a\n" | 328 " This target type allows you to create meta-targets that just collect a\n" |
329 " set of dependencies into one named target. Groups can additionally\n" | 329 " set of dependencies into one named target. Groups can additionally\n" |
330 " specify configs that apply to their dependents.\n" | 330 " specify configs that apply to their dependents.\n" |
331 "\n" | 331 "\n" |
332 " Depending on a group is exactly like depending directly on that\n" | 332 " Depending on a group is exactly like depending directly on that\n" |
333 " group's deps. Direct dependent configs will get automatically\n" | 333 " group's deps. \n" |
334 " forwarded through the group so you shouldn't need to use\n" | |
335 " \"forward_dependent_configs_from.\n" | |
336 "\n" | 334 "\n" |
337 "Variables\n" | 335 "Variables\n" |
338 "\n" | 336 "\n" |
339 DEPS_VARS | 337 DEPS_VARS |
340 DEPENDENT_CONFIG_VARS | 338 DEPENDENT_CONFIG_VARS |
341 "\n" | 339 "\n" |
342 "Example\n" | 340 "Example\n" |
343 "\n" | 341 "\n" |
344 " group(\"all\") {\n" | 342 " group(\"all\") {\n" |
345 " deps = [\n" | 343 " deps = [\n" |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 const Template* templ = scope->GetTemplate(target_type); | 519 const Template* templ = scope->GetTemplate(target_type); |
522 if (templ) | 520 if (templ) |
523 return templ->Invoke(scope, function, sub_args, block, err); | 521 return templ->Invoke(scope, function, sub_args, block, err); |
524 | 522 |
525 // Otherwise, assume the target is a built-in target type. | 523 // Otherwise, assume the target is a built-in target type. |
526 return ExecuteGenericTarget(target_type.c_str(), scope, function, sub_args, | 524 return ExecuteGenericTarget(target_type.c_str(), scope, function, sub_args, |
527 block, err); | 525 block, err); |
528 } | 526 } |
529 | 527 |
530 } // namespace functions | 528 } // namespace functions |
OLD | NEW |