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

Unified Diff: tools/gn/source_file.cc

Issue 26561005: GYP generator for GN (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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/source_file.cc
diff --git a/tools/gn/source_file.cc b/tools/gn/source_file.cc
index 62f8fb11a45c33fa2cc41618f392c0b35efb9a13..e5d67753e7f4a958bf09542fd3ead162ae94bcf8 100644
--- a/tools/gn/source_file.cc
+++ b/tools/gn/source_file.cc
@@ -46,22 +46,18 @@ base::FilePath SourceFile::Resolve(const base::FilePath& source_root) const {
return base::FilePath();
std::string converted;
-#if defined(OS_WIN)
if (is_system_absolute()) {
- converted.assign(&value_[1], value_.size() - 1);
- DCHECK(converted.size() > 2 && converted[1] == ':')
- << "Expecting Windows absolute file path with a drive letter: "
- << value_;
+ if (value_.size() > 2 && value_[2] == ':') {
+ // Windows path, strip the leading slash.
+ converted.assign(&value_[1], value_.size() - 1);
+ } else {
+ converted.assign(value_);
+ }
+ ConvertPathToSystem(&converted);
return base::FilePath(UTF8ToFilePath(converted));
}
converted.assign(&value_[2], value_.size() - 2);
ConvertPathToSystem(&converted);
return source_root.Append(UTF8ToFilePath(converted));
-#else
- if (is_system_absolute())
- return base::FilePath(value_);
- converted.assign(&value_[2], value_.size() - 2);
- return source_root.Append(converted);
-#endif
}
« tools/gn/source_dir.cc ('K') | « tools/gn/source_dir.cc ('k') | tools/gn/target.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698