Index: tools/gn/variables.cc |
diff --git a/tools/gn/variables.cc b/tools/gn/variables.cc |
index c6cc06895518d054c54c6417af8d2c391126cd15..1bf301af1c90f6dada7e2e9f3bb440f974ddc1a8 100644 |
--- a/tools/gn/variables.cc |
+++ b/tools/gn/variables.cc |
@@ -262,6 +262,41 @@ const char kAllDependentConfigs_Help[] = |
" See also \"direct_dependent_configs\".\n" |
COMMON_ORDERING_HELP; |
+const char kAllowCircularIncludesFrom[] = "allow_circular_includes_from"; |
+const char kAllowCircularIncludesFrom_HelpShort[] = |
+ "allow_circular_includes_from: [label list] Permit includes from deps."; |
+const char kAllowCircularIncludesFrom_Help[] = |
+ "allow_circular_includes_from: Permit includes from deps.\n" |
+ "\n" |
+ " A list of target labels. Must be a subset of the target's \"deps\".\n" |
+ " These targets will be permitted to include headers from the current\n" |
+ " target despite the dependency going in the opposite direction.\n" |
+ "\n" |
+ "Tedious exposition\n" |
+ "\n" |
+ " Normally, for a file in target A to include a file from target B,\n" |
+ " A must list B as a dependency. This invariant is enforced by the\n" |
+ " \"gn check\" command (and the --check flag to \"gn gen\").\n" |
+ "\n" |
+ " Sometimes, two targets might be the same unit for linking purposes\n" |
+ " (two source sets or static libraries that would always be linked\n" |
+ " together in a final executable or shared library). In this case,\n" |
+ " you want A to be able to include B's headers, and B to include A's\n" |
+ " headers.\n" |
+ "\n" |
+ " This list, if specified, lists which of the dependencies of the\n" |
+ " current target can include header files from the current target.\n" |
+ " That is, if A depends on B, B can only include headers from A if it is\n" |
+ " in A's allow_circular_includes_from list.\n" |
+ "\n" |
+ "Example\n" |
+ "\n" |
+ " source_set(\"a\") {\n" |
+ " deps = [ \":b\", \":c\" ]\n" |
+ " allow_circular_includes_from = [ \":b\" ]\n" |
+ " ...\n" |
+ " }\n"; |
+ |
const char kArgs[] = "args"; |
const char kArgs_HelpShort[] = |
"args: [string list] Arguments passed to an action."; |
@@ -311,6 +346,28 @@ const char kCflagsObjCC_HelpShort[] = |
"cflags_objcc: [string list] Flags passed to the Objective C++ compiler."; |
const char* kCflagsObjCC_Help = kCommonCflagsHelp; |
+const char kCheckIncludes[] = "check_includes"; |
+const char kCheckIncludes_HelpShort[] = |
+ "check_includes: [boolean] Controls whether a target's files are checked."; |
+const char kCheckIncludes_Help[] = |
+ "check_includes: [boolean] Controls whether a target's files are checked.\n" |
+ "\n" |
+ " When true (the default), the \"gn check\" command (as well as\n" |
+ " \"gn gen\" with the --check flag) will check this target's sources\n" |
+ " and headers for proper dependencies.\n" |
+ "\n" |
+ " When false, the files in this target will be skipped by default.\n" |
+ " This does not affect other targets that depend on the current target,\n" |
+ " it just skips checking the includes of the current target's files.\n" |
+ "\n" |
+ "Example\n" |
+ "\n" |
+ " source_set(\"busted_includes\") {\n" |
+ " # This target's includes are messed up, exclude it from checking.\n" |
+ " check_includes = false\n" |
+ " ...\n" |
+ " }\n"; |
+ |
const char kConfigs[] = "configs"; |
const char kConfigs_HelpShort[] = |
"configs: [label list] Configs applying to this target."; |
@@ -831,12 +888,14 @@ const VariableInfoMap& GetTargetVariables() { |
static VariableInfoMap info_map; |
if (info_map.empty()) { |
INSERT_VARIABLE(AllDependentConfigs) |
+ INSERT_VARIABLE(AllowCircularIncludesFrom) |
INSERT_VARIABLE(Args) |
INSERT_VARIABLE(Cflags) |
INSERT_VARIABLE(CflagsC) |
INSERT_VARIABLE(CflagsCC) |
INSERT_VARIABLE(CflagsObjC) |
INSERT_VARIABLE(CflagsObjCC) |
+ INSERT_VARIABLE(CheckIncludes) |
INSERT_VARIABLE(Configs) |
INSERT_VARIABLE(Data) |
INSERT_VARIABLE(Datadeps) |