Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(450)

Unified Diff: tools/gn/variables.cc

Issue 216903004: Add optional public header checking to GN build (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: unit test Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/variables.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « tools/gn/variables.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698