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

Unified Diff: tools/gn/source_dir.cc

Issue 1455203002: [GN] Add support to rebase_path to resolve paths above the source root. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Add tests, handle Windows sources. Created 5 years 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/function_rebase_path_unittest.cc ('k') | tools/gn/source_dir_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/source_dir.cc
diff --git a/tools/gn/source_dir.cc b/tools/gn/source_dir.cc
index 0966cc604eea55b63db42716aa1fb898bce3b28e..d9fb4cc228bbfdc44d86893ab3fcdb254b37a22d 100644
--- a/tools/gn/source_dir.cc
+++ b/tools/gn/source_dir.cc
@@ -71,7 +71,7 @@ SourceFile SourceDir::ResolveRelativeFile(
if (str.size() >= 2 && str[0] == '/' && str[1] == '/') {
// Source-relative.
ret.value_.assign(str.data(), str.size());
- NormalizePath(&ret.value_);
+ NormalizePath(&ret.value_, source_root);
return ret;
} else if (IsPathAbsolute(str)) {
if (source_root.empty() ||
@@ -145,7 +145,7 @@ SourceDir SourceDir::ResolveRelativeDir(
ret.value_.assign(str.data(), str.size());
if (!EndsWithSlash(ret.value_))
ret.value_.push_back('/');
- NormalizePath(&ret.value_);
+ NormalizePath(&ret.value_, source_root);
return ret;
} else if (IsPathAbsolute(str)) {
if (source_root.empty() ||
« no previous file with comments | « tools/gn/function_rebase_path_unittest.cc ('k') | tools/gn/source_dir_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698