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

Unified Diff: tools/gn/filesystem_utils.h

Issue 630223002: gn: Support build directories outside the source tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated patch set Created 6 years, 1 month 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/filesystem_utils.h
diff --git a/tools/gn/filesystem_utils.h b/tools/gn/filesystem_utils.h
index 20773cc7dd6a9e2354c943fb06211fca88a676ef..d7415c9887bf574fc0a196fb9448844acb650556 100644
--- a/tools/gn/filesystem_utils.h
+++ b/tools/gn/filesystem_utils.h
@@ -116,11 +116,6 @@ bool MakeAbsolutePathRelativeIfPossible(const base::StringPiece& source_root,
const base::StringPiece& path,
std::string* dest);
-// Converts a directory to its inverse (e.g. "/foo/bar/" -> "../../").
-// This will be the empty string for the root directories ("/" and "//"), and
-// in all other cases, this is guaranteed to end in a slash.
-std::string InvertDir(const SourceDir& dir);
-
// Collapses "." and sequential "/"s and evaluates "..".
void NormalizePath(std::string* path);
@@ -128,10 +123,16 @@ void NormalizePath(std::string* path);
// for other systems.
void ConvertPathToSystem(std::string* path);
-// Takes a source-absolute path (must begin with "//") and makes it relative
-// to the given directory, which also must be source-absolute.
-std::string RebaseSourceAbsolutePath(const std::string& input,
- const SourceDir& dest_dir);
+// Takes a path, |input|, and makes it relative to the given directory
+// |dest_dir|. Both inputs may be source-relative (e.g. begins with
+// with "//") or may be absolute.
+//
+// If supplied, the |source_root| parameter must be the absolute path
brettw 2014/11/05 19:59:49 "must be" -> "is the". Can you explain here what h
zeuthen 2014/11/07 19:24:12 Done.
+// to the source root and not end in a slash.
+std::string RebaseSourceAbsolutePath(
+ const std::string& input,
+ const SourceDir& dest_dir,
+ const base::StringPiece& source_root = base::StringPiece());
// Returns the given directory with no terminating slash at the end, such that
// appending a slash and more stuff will produce a valid path.

Powered by Google App Engine
This is Rietveld 408576698