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 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 " For copy targets, the outputs is the destination for the copied\n" | 677 " For copy targets, the outputs is the destination for the copied\n" |
678 " file(s). For actions, the outputs should be the list of files\n" | 678 " file(s). For actions, the outputs should be the list of files\n" |
679 " generated by the script.\n"; | 679 " generated by the script.\n"; |
680 | 680 |
681 const char kPublic[] = "public"; | 681 const char kPublic[] = "public"; |
682 const char kPublic_HelpShort[] = | 682 const char kPublic_HelpShort[] = |
683 "public: [file list] Declare public header files for a target."; | 683 "public: [file list] Declare public header files for a target."; |
684 const char kPublic_Help[] = | 684 const char kPublic_Help[] = |
685 "public: Declare public header files for a target.\n" | 685 "public: Declare public header files for a target.\n" |
686 "\n" | 686 "\n" |
687 " A list of files that other targets can include. These permissions are\n" | 687 " A list of files and patterns that other targets can include. These\n" |
688 " checked via the \"check\" command (see \"gn help check\").\n" | 688 " permissions are checked via the \"check\" command\n" |
| 689 " (see \"gn help check\").\n" |
689 "\n" | 690 "\n" |
690 " If no public files are declared, other targets (assuming they have\n" | 691 " If no public files are declared, other targets (assuming they have\n" |
691 " visibility to depend on this target can include any file in the\n" | 692 " visibility to depend on this target) can include any file. If this\n" |
692 " sources list. If this variable is defined on a target, dependent\n" | 693 " variable is defined on a target, dependent targets may only include\n" |
693 " targets may only include files on this whitelist.\n" | 694 " files on this whitelist.\n" |
| 695 "\n" |
| 696 " The entries in this list are patterns (see \"gn help patterns\") so\n" |
| 697 " you can use simple wildcard matching if you have a directory of public\n" |
| 698 " files.\n" |
694 "\n" | 699 "\n" |
695 " Header file permissions are also subject to visibility. A target\n" | 700 " Header file permissions are also subject to visibility. A target\n" |
696 " must be visible to another target to include any files from it at all\n" | 701 " must be visible to another target to include any files from it at all\n" |
697 " and the public headers indicate which subset of those files are\n" | 702 " and the public headers indicate which subset of those files are\n" |
698 " permitted. See \"gn help visibility\" for more.\n" | 703 " permitted.\n" |
699 "\n" | 704 "\n" |
700 " Public files are inherited through the dependency tree. So if there is\n" | 705 " Public files are inherited through the dependency tree. So if there is\n" |
701 " a dependency A -> B -> C, then A can include C's public headers.\n" | 706 " a dependency A -> B -> C, then A can include C's public headers.\n" |
702 " However, the same is NOT true of visibility, so unless A is in C's\n" | 707 " However, the same is NOT true of visibility, so unless A is in C's\n" |
703 " visibility list, the include will be rejected.\n" | 708 " visibility list, the include will be rejected.\n" |
704 "\n" | 709 "\n" |
705 " GN only knows about files declared in the \"sources\" and \"public\"\n" | |
706 " sections of targets. If a file is included that is now known to the\n" | |
707 " build, it will be allowed.\n" | |
708 "\n" | |
709 "Examples:\n" | 710 "Examples:\n" |
710 " These exact files are public:\n" | 711 " These exact files are public:\n" |
711 " public = [ \"foo.h\", \"bar.h\" ]\n" | 712 " public = [ \"foo.h\", \"bar.h\" ]\n" |
712 "\n" | 713 "\n" |
| 714 " All files in the \"public\" directory are public:\n" |
| 715 " public = [ \"public/*\" ]\n" |
| 716 "\n" |
713 " No files are public (no targets may include headers from this one):\n" | 717 " No files are public (no targets may include headers from this one):\n" |
714 " public = []\n"; | 718 " public = []\n"; |
715 | 719 |
716 const char kScript[] = "script"; | 720 const char kScript[] = "script"; |
717 const char kScript_HelpShort[] = | 721 const char kScript_HelpShort[] = |
718 "script: [file name] Script file for actions."; | 722 "script: [file name] Script file for actions."; |
719 const char kScript_Help[] = | 723 const char kScript_Help[] = |
720 "script: Script file for actions.\n" | 724 "script: Script file for actions.\n" |
721 "\n" | 725 "\n" |
722 " An absolute or buildfile-relative file name of a Python script to run\n" | 726 " An absolute or buildfile-relative file name of a Python script to run\n" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
910 INSERT_VARIABLE(SourcePrereqs) | 914 INSERT_VARIABLE(SourcePrereqs) |
911 INSERT_VARIABLE(Sources) | 915 INSERT_VARIABLE(Sources) |
912 INSERT_VARIABLE(Visibility) | 916 INSERT_VARIABLE(Visibility) |
913 } | 917 } |
914 return info_map; | 918 return info_map; |
915 } | 919 } |
916 | 920 |
917 #undef INSERT_VARIABLE | 921 #undef INSERT_VARIABLE |
918 | 922 |
919 } // namespace variables | 923 } // namespace variables |
OLD | NEW |