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

Unified Diff: tools/gn/header_checker.cc

Issue 1820493002: Add more documentation for GN header checking (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
Index: tools/gn/header_checker.cc
diff --git a/tools/gn/header_checker.cc b/tools/gn/header_checker.cc
index ada9d70da47fcaf0e250eb5f2806af0753cbd2e9..259f9f675ee2dbe26abb8a59802f9217fc6b8db7 100644
--- a/tools/gn/header_checker.cc
+++ b/tools/gn/header_checker.cc
@@ -298,14 +298,11 @@ bool HeaderChecker::CheckFile(const Target* from_target,
}
// If the file exists:
-// - It must be in one or more dependencies of the given target.
-// - Those dependencies must have visibility from the source file.
-// - The header must be in the public section of those dependeices.
-// - Those dependencies must either have no direct dependent configs with
-// flags that affect the compiler, or those direct dependent configs apply
-// to the "from_target" (it's one "hop" away). This ensures that if the
-// include file needs needs compiler settings to compile it, that those
-// settings are applied to the file including it.
+// - The header must be in the public section of a target, or it must
+// be in the sources with no public list (everything is implicitly public).
+// - The dependency path to the included target must follow only public_deps.
+// - If there are multiple targets with the header in it, only one need be
+// valid for the check to pass.
bool HeaderChecker::CheckInclude(const Target* from_target,
const InputFile& source_file,
const SourceFile& include_file,
« no previous file with comments | « tools/gn/docs/reference.md ('k') | tools/gn/variables.cc » ('j') | tools/gn/variables.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698