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

Unified Diff: tools/gn/value_extractors.cc

Issue 1621053002: Add an assert_no_deps variable to GN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment fix Created 4 years, 11 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/value_extractors.h ('k') | tools/gn/variables.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/value_extractors.cc
diff --git a/tools/gn/value_extractors.cc b/tools/gn/value_extractors.cc
index 23c5a2726dc8f8c78c4f11ca74a3b06bc4de41ff..ff009ce1b59e044ae97fe69157b3f40df965bab5 100644
--- a/tools/gn/value_extractors.cc
+++ b/tools/gn/value_extractors.cc
@@ -144,6 +144,17 @@ template<typename T> struct LabelPtrResolver {
const Label& current_toolchain;
};
+struct LabelPatternResolver {
+ LabelPatternResolver(const SourceDir& current_dir_in)
+ : current_dir(current_dir_in) {
+ }
+ bool operator()(const Value& v, LabelPattern* out, Err* err) const {
+ *out = LabelPattern::GetPattern(current_dir, v, err);
+ return !err->has_error();
+ }
+ const SourceDir& current_dir;
+};
+
} // namespace
bool ExtractListOfStringValues(const Value& value,
@@ -236,3 +247,11 @@ bool ExtractRelativeFile(const BuildSettings* build_settings,
RelativeFileConverter converter(build_settings, current_dir);
return converter(value, file, err);
}
+
+bool ExtractListOfLabelPatterns(const Value& value,
+ const SourceDir& current_dir,
+ std::vector<LabelPattern>* patterns,
+ Err* err) {
+ return ListValueExtractor(value, patterns, err,
+ LabelPatternResolver(current_dir));
+}
« no previous file with comments | « tools/gn/value_extractors.h ('k') | tools/gn/variables.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698