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/variables.h" | 5 #include "tools/gn/variables.h" |
6 | 6 |
7 namespace variables { | 7 namespace variables { |
8 | 8 |
9 // Built-in variables ---------------------------------------------------------- | 9 // Built-in variables ---------------------------------------------------------- |
10 | 10 |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 "\n" | 459 "\n" |
460 " This addition happens in a second phase once a target and all of its\n" | 460 " This addition happens in a second phase once a target and all of its\n" |
461 " dependencies have been resolved. Therefore, a target will not see\n" | 461 " dependencies have been resolved. Therefore, a target will not see\n" |
462 " these force-added configs in their \"configs\" variable while the\n" | 462 " these force-added configs in their \"configs\" variable while the\n" |
463 " script is running, and then can not be removed. As a result, this\n" | 463 " script is running, and then can not be removed. As a result, this\n" |
464 " capability should generally only be used to add defines and include\n" | 464 " capability should generally only be used to add defines and include\n" |
465 " directories necessary to compile a target's headers.\n" | 465 " directories necessary to compile a target's headers.\n" |
466 "\n" | 466 "\n" |
467 " See also \"all_dependent_configs\".\n"; | 467 " See also \"all_dependent_configs\".\n"; |
468 | 468 |
469 const char kExternal[] = "external"; | |
470 const char kExternal_HelpShort[] = | |
471 "external: [boolean] Declares a target as externally generated."; | |
472 const char kExternal_Help[] = | |
473 "external: Declares a target as externally generated.\n" | |
474 "\n" | |
475 " External targets are treated like normal targets as far as dependent\n" | |
476 " targets are concerned, but do not actually have their .ninja file\n" | |
477 " written to disk. This allows them to be generated by an external\n" | |
478 " program (e.g. GYP).\n" | |
479 "\n" | |
480 " See also \"gn help gyp\".\n" | |
481 "\n" | |
482 "Example:\n" | |
483 " static_library(\"foo\") {\n" | |
484 " external = true\n" | |
485 " }\n"; | |
486 | |
487 const char kForwardDependentConfigsFrom[] = "forward_dependent_configs_from"; | 469 const char kForwardDependentConfigsFrom[] = "forward_dependent_configs_from"; |
488 const char kForwardDependentConfigsFrom_HelpShort[] = | 470 const char kForwardDependentConfigsFrom_HelpShort[] = |
489 "forward_dependent_configs_from: [label list] Forward dependent's configs."; | 471 "forward_dependent_configs_from: [label list] Forward dependent's configs."; |
490 const char kForwardDependentConfigsFrom_Help[] = | 472 const char kForwardDependentConfigsFrom_Help[] = |
491 "forward_dependent_configs_from\n" | 473 "forward_dependent_configs_from\n" |
492 "\n" | 474 "\n" |
493 " A list of target labels.\n" | 475 " A list of target labels.\n" |
494 "\n" | 476 "\n" |
495 " Exposes the direct_dependent_configs from a dependent target as\n" | 477 " Exposes the direct_dependent_configs from a dependent target as\n" |
496 " direct_dependent_configs of the current one. Each label in this list\n" | 478 " direct_dependent_configs of the current one. Each label in this list\n" |
(...skipping 19 matching lines...) Expand all Loading... |
516 "\n" | 498 "\n" |
517 " group(\"frob\") {\n" | 499 " group(\"frob\") {\n" |
518 " if (use_system_frob) {\n" | 500 " if (use_system_frob) {\n" |
519 " deps = \":system_frob\"\n" | 501 " deps = \":system_frob\"\n" |
520 " } else {\n" | 502 " } else {\n" |
521 " deps = \"//third_party/fallback_frob\"\n" | 503 " deps = \"//third_party/fallback_frob\"\n" |
522 " }\n" | 504 " }\n" |
523 " forward_dependent_configs_from = deps\n" | 505 " forward_dependent_configs_from = deps\n" |
524 " }\n"; | 506 " }\n"; |
525 | 507 |
526 const char kGypFile[] = "gyp_file"; | |
527 const char kGypFile_HelpShort[] = | |
528 "gyp_file: [file name] Name of GYP file to write to in GYP mode."; | |
529 const char kGypFile_Help[] = | |
530 "gyp_file: Name of GYP file to write to in GYP mode.\n" | |
531 "\n" | |
532 " See \"gn help gyp\" for an overview of how this works.\n" | |
533 "\n" | |
534 " Tip: If all targets in a given BUILD.gn file should go in the same\n" | |
535 " GYP file, just put gyp_file = \"foo\" at the top of the file and\n" | |
536 " the variable will be in scope for all targets.\n"; | |
537 | |
538 const char kGypHeader[] = "gyp_header"; | |
539 const char kGypHeader_HelpShort[] = | |
540 "gyp_header: [string] Extra stuff to prepend to GYP files."; | |
541 const char kGypHeader_Help[] = | |
542 "gyp_header: Extra stuff to prepend to GYP files.\n" | |
543 "\n" | |
544 " A Python dictionary string. This will be inserted after the initial\n" | |
545 " \"{\" in the GYP file. It is expected this is used to define the\n" | |
546 " make_global_settings.\n" | |
547 "\n" | |
548 " This string should end in a comma to keep the python dictionary syntax\n" | |
549 " valid when everything is concatenated.\n"; | |
550 | |
551 const char kHardDep[] = "hard_dep"; | 508 const char kHardDep[] = "hard_dep"; |
552 const char kHardDep_HelpShort[] = | 509 const char kHardDep_HelpShort[] = |
553 "hard_dep: [boolean] Indicates a target should be built before dependees."; | 510 "hard_dep: [boolean] Indicates a target should be built before dependees."; |
554 const char kHardDep_Help[] = | 511 const char kHardDep_Help[] = |
555 "hard_dep: Indicates a target should be built before dependees.\n" | 512 "hard_dep: Indicates a target should be built before dependees.\n" |
556 "\n" | 513 "\n" |
557 " Ninja's default is to assume that targets can be compiled\n" | 514 " Ninja's default is to assume that targets can be compiled\n" |
558 " independently. This breaks down for generated files that are included\n" | 515 " independently. This breaks down for generated files that are included\n" |
559 " in other targets because Ninja doesn't know to run the generator\n" | 516 " in other targets because Ninja doesn't know to run the generator\n" |
560 " before compiling the source file.\n" | 517 " before compiling the source file.\n" |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 INSERT_VARIABLE(CflagsC) | 787 INSERT_VARIABLE(CflagsC) |
831 INSERT_VARIABLE(CflagsCC) | 788 INSERT_VARIABLE(CflagsCC) |
832 INSERT_VARIABLE(CflagsObjC) | 789 INSERT_VARIABLE(CflagsObjC) |
833 INSERT_VARIABLE(CflagsObjCC) | 790 INSERT_VARIABLE(CflagsObjCC) |
834 INSERT_VARIABLE(Configs) | 791 INSERT_VARIABLE(Configs) |
835 INSERT_VARIABLE(Data) | 792 INSERT_VARIABLE(Data) |
836 INSERT_VARIABLE(Datadeps) | 793 INSERT_VARIABLE(Datadeps) |
837 INSERT_VARIABLE(Depfile) | 794 INSERT_VARIABLE(Depfile) |
838 INSERT_VARIABLE(Deps) | 795 INSERT_VARIABLE(Deps) |
839 INSERT_VARIABLE(DirectDependentConfigs) | 796 INSERT_VARIABLE(DirectDependentConfigs) |
840 INSERT_VARIABLE(External) | |
841 INSERT_VARIABLE(ForwardDependentConfigsFrom) | 797 INSERT_VARIABLE(ForwardDependentConfigsFrom) |
842 INSERT_VARIABLE(GypFile) | |
843 INSERT_VARIABLE(GypHeader) | |
844 INSERT_VARIABLE(HardDep) | 798 INSERT_VARIABLE(HardDep) |
845 INSERT_VARIABLE(IncludeDirs) | 799 INSERT_VARIABLE(IncludeDirs) |
846 INSERT_VARIABLE(Ldflags) | 800 INSERT_VARIABLE(Ldflags) |
847 INSERT_VARIABLE(Libs) | 801 INSERT_VARIABLE(Libs) |
848 INSERT_VARIABLE(LibDirs) | 802 INSERT_VARIABLE(LibDirs) |
849 INSERT_VARIABLE(OutputExtension) | 803 INSERT_VARIABLE(OutputExtension) |
850 INSERT_VARIABLE(OutputName) | 804 INSERT_VARIABLE(OutputName) |
851 INSERT_VARIABLE(Outputs) | 805 INSERT_VARIABLE(Outputs) |
852 INSERT_VARIABLE(Script) | 806 INSERT_VARIABLE(Script) |
853 INSERT_VARIABLE(SourcePrereqs) | 807 INSERT_VARIABLE(SourcePrereqs) |
854 INSERT_VARIABLE(Sources) | 808 INSERT_VARIABLE(Sources) |
855 } | 809 } |
856 return info_map; | 810 return info_map; |
857 } | 811 } |
858 | 812 |
859 #undef INSERT_VARIABLE | 813 #undef INSERT_VARIABLE |
860 | 814 |
861 } // namespace variables | 815 } // namespace variables |
OLD | NEW |