diff options
author | tkent@chromium.org <tkent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-15 06:53:52 +0000 |
---|---|---|
committer | tkent@chromium.org <tkent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-15 06:53:52 +0000 |
commit | 14a25e5040c14ac6760509693e971781cce21705 (patch) | |
tree | f66d204c0e8b0177b9bc4299cfe3423388d1d763 /base/base_paths_posix.cc | |
parent | 8cff4c7cfbc5d1805a8e4a87fcd60bcab097dfd0 (diff) | |
download | chromium_src-14a25e5040c14ac6760509693e971781cce21705.zip chromium_src-14a25e5040c14ac6760509693e971781cce21705.tar.gz chromium_src-14a25e5040c14ac6760509693e971781cce21705.tar.bz2 |
Support for DIR_SOURCE_ROOT in a case of WebKit-only checkout.
BUG=none
TEST=none. It's hard to write tests for DIR_SOURCE_ROOT without DIR_SOURCE_ROOT.
Review URL: http://codereview.chromium.org/2865002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49769 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/base_paths_posix.cc')
-rw-r--r-- | base/base_paths_posix.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/base/base_paths_posix.cc b/base/base_paths_posix.cc index e55d10c..710d799 100644 --- a/base/base_paths_posix.cc +++ b/base/base_paths_posix.cc @@ -82,6 +82,16 @@ bool PathProviderPosix(int key, FilePath* result) { return true; } } + // In a case of WebKit-only checkout, executable files are put into + // WebKit/out/{Debug|Release}, and we should return WebKit/WebKit/chromium + // for DIR_SOURCE_ROOT. + if (PathService::Get(base::DIR_EXE, &path)) { + path = path.DirName().DirName().Append("WebKit/chromium"); + if (file_util::PathExists(path.Append("base/base_paths_posix.cc"))) { + *result = path; + return true; + } + } // If that failed (maybe the build output is symlinked to a different // drive) try assuming the current directory is the source root. if (file_util::GetCurrentDirectory(&path) && |