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

Unified Diff: tools/gn/label_pattern.cc

Issue 630223002: gn: Support build directories outside the source tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/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"

Powered by Google App Engine
This is Rietveld 408576698