summaryrefslogtreecommitdiffstats
path: root/tools/gn/setup.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-27 23:26:40 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-27 23:26:40 +0000
commit858ceda682777affb22d41ee99adedeac946431b (patch)
tree50fb1d7d1f9a2661c3382a4d5f9a977f9240f62c /tools/gn/setup.cc
parent0329bef28e5938a0fc6a1953c313aac3f205f4eb (diff)
downloadchromium_src-858ceda682777affb22d41ee99adedeac946431b.zip
chromium_src-858ceda682777affb22d41ee99adedeac946431b.tar.gz
chromium_src-858ceda682777affb22d41ee99adedeac946431b.tar.bz2
Do more slash normalization in GN.
This makes GN more aggressive about converting backslashes into forward-slashes, and makes the path handling functions mostly indifferent with regard to the two types of slashes. The previous behavior was a bit confusing in that you would end up with strings like "//out\Debug/" on Windows, and certain operations on this would fail. With this change, the backslash will be more aggressively converted. The downside is that Posix filenames with literal backslashes in them are now unrepresentable in GN. But I think for a cross-platform system on constrained input (build files) this is a reasonable tradeoff for more consistent path handling. R=scottmg@chromium.org Review URL: https://codereview.chromium.org/177003008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253969 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/gn/setup.cc')
-rw-r--r--tools/gn/setup.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/gn/setup.cc b/tools/gn/setup.cc
index 91201bb..5f30cf8 100644
--- a/tools/gn/setup.cc
+++ b/tools/gn/setup.cc
@@ -294,9 +294,11 @@ bool Setup::FillSourceDir(const CommandLine& cmdline) {
}
bool Setup::FillBuildDir(const std::string& build_dir) {
+ std::string normalized_build_dir = PathToSystem(build_dir);
+
SourceDir resolved =
SourceDirForCurrentDirectory(build_settings_.root_path()).
- ResolveRelativeDir(build_dir);
+ ResolveRelativeDir(normalized_build_dir);
if (resolved.is_null()) {
Err(Location(), "Couldn't resolve build directory.",
"The build directory supplied (\"" + build_dir + "\") was not valid.").