Index: tools/gn/variables.cc |
diff --git a/tools/gn/variables.cc b/tools/gn/variables.cc |
index 40f60aa525f58ef9b279389df5d6f5a1db5e00a4..8e41e62cbe5ff40aae006202f931939ab42ac022 100644 |
--- a/tools/gn/variables.cc |
+++ b/tools/gn/variables.cc |
@@ -678,6 +678,45 @@ const char kOutputs_Help[] = |
" file(s). For actions, the outputs should be the list of files\n" |
" generated by the script.\n"; |
+const char kPublic[] = "public"; |
+const char kPublic_HelpShort[] = |
+ "public: [file list] Declare public header files for a target."; |
+const char kPublic_Help[] = |
+ "public: Declare public header files for a target.\n" |
+ "\n" |
+ " A list of files and patterns that other targets can include. These\n" |
+ " permissions are checked via the \"check\" command\n" |
+ " (see \"gn help check\").\n" |
+ "\n" |
+ " If no public files are declared, other targets (assuming they have\n" |
+ " visibility to depend on this target) can include any file. If this\n" |
+ " variable is defined on a target, dependent targets may only include\n" |
+ " files on this whitelist.\n" |
+ "\n" |
+ " The entries in this list are patterns (see \"gn help patterns\") so\n" |
+ " you can use simple wildcard matching if you have a directory of public\n" |
+ " files.\n" |
+ "\n" |
+ " Header file permissions are also subject to visibility. A target\n" |
+ " must be visible to another target to include any files from it at all\n" |
+ " and the public headers indicate which subset of those files are\n" |
+ " permitted.\n" |
+ "\n" |
+ " Public files are inherited through the dependency tree. So if there is\n" |
+ " a dependency A -> B -> C, then A can include C's public headers.\n" |
+ " However, the same is NOT true of visibility, so unless A is in C's\n" |
+ " visibility list, the include will be rejected.\n" |
+ "\n" |
+ "Examples:\n" |
+ " These exact files are public:\n" |
+ " public = [ \"foo.h\", \"bar.h\" ]\n" |
+ "\n" |
+ " All files in the \"public\" directory are public:\n" |
+ " public = [ \"public/*\" ]\n" |
+ "\n" |
+ " No files are public (no targets may include headers from this one):\n" |
+ " public = []\n"; |
+ |
const char kScript[] = "script"; |
const char kScript_HelpShort[] = |
"script: [file name] Script file for actions."; |
@@ -870,6 +909,7 @@ const VariableInfoMap& GetTargetVariables() { |
INSERT_VARIABLE(OutputExtension) |
INSERT_VARIABLE(OutputName) |
INSERT_VARIABLE(Outputs) |
+ INSERT_VARIABLE(Public) |
INSERT_VARIABLE(Script) |
INSERT_VARIABLE(SourcePrereqs) |
INSERT_VARIABLE(Sources) |