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

Unified Diff: tools/gn/variables.cc

Issue 516683002: Add GN variables for controlling header checking. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@desc
Patch Set: Created 6 years, 4 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
« tools/gn/value_extractors.h ('K') | « 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 94e278722c141f8661a307db18fc93c409da5db6..a9c5b9bc46271bd377c2554fc130b0bf2830c828 100644
--- a/tools/gn/variables.cc
+++ b/tools/gn/variables.cc
@@ -281,6 +281,37 @@ 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 include cycles.";
viettrungluu 2014/08/28 19:47:54 "include cycles" is inaccurate and misleading.
+const char kAllowCircularIncludesFrom_Help[] =
+ "allow_circular_includes_from: Permit include cycles from listed targets.\n"
viettrungluu 2014/08/28 19:47:54 "Permit includes from the listed targets, which ar
+ "\n"
+ " A list of target labels. Must be a subset of the target's \"deps\".\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"
viettrungluu 2014/08/27 23:30:40 Does A have to depend on B? What if you put B in t
brettw 2014/08/28 05:46:16 It must depend on B directly, there is code in the
+ " 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.";
@@ -330,6 +361,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.";
@@ -851,12 +904,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)
« tools/gn/value_extractors.h ('K') | « tools/gn/variables.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698