Index: tools/gn/label_pattern.cc |
diff --git a/tools/gn/label_pattern.cc b/tools/gn/label_pattern.cc |
index 752898f1acace2f03bdddc25315da680728b6d00..88546b60942c4feb5f96246c7f44f9eb938200bf 100644 |
--- a/tools/gn/label_pattern.cc |
+++ b/tools/gn/label_pattern.cc |
@@ -61,7 +61,8 @@ LabelPattern::~LabelPattern() { |
} |
// static |
-LabelPattern LabelPattern::GetPattern(const SourceDir& current_dir, |
+LabelPattern LabelPattern::GetPattern(const base::FilePath& source_root, |
+ const SourceDir& current_dir, |
const Value& value, |
Err* err) { |
if (!value.VerifyTypeIs(Value::STRING, err)) |
@@ -77,7 +78,7 @@ LabelPattern LabelPattern::GetPattern(const SourceDir& current_dir, |
// label resolution code to get all the implicit name stuff. |
size_t star = str.find('*'); |
if (star == std::string::npos) { |
- Label label = Label::Resolve(current_dir, Label(), value, err); |
+ Label label = Label::Resolve(current_dir, Label(), value, source_root, err); |
if (err->has_error()) |
return LabelPattern(); |
@@ -110,7 +111,8 @@ LabelPattern LabelPattern::GetPattern(const SourceDir& current_dir, |
// Parse the inside of the parens as a label for a toolchain. |
Value value_for_toolchain(value.origin(), toolchain_string); |
toolchain_label = |
- Label::Resolve(current_dir, Label(), value_for_toolchain, err); |
+ Label::Resolve(current_dir, Label(), value_for_toolchain, source_root, |
+ err); |
if (err->has_error()) |
return LabelPattern(); |
@@ -166,7 +168,7 @@ LabelPattern LabelPattern::GetPattern(const SourceDir& current_dir, |
} |
// Resolve the non-wildcard stuff. |
- dir = current_dir.ResolveRelativeDir(path); |
+ dir = current_dir.ResolveRelativeDir(path, source_root); |
if (dir.is_null()) { |
*err = Err(value, "Label pattern didn't resolve to a dir.", |
"The directory name \"" + path.as_string() + "\" didn't\n" |