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)); |
+} |