summaryrefslogtreecommitdiffstats
path: root/Source/cmDependsC.cxx
diff options
context:
space:
mode:
authorPavel Shramov <Pavel.Shramov@micex.com>2013-06-19 12:35:23 (GMT)
committerBrad King <brad.king@kitware.com>2013-06-26 14:14:31 (GMT)
commit551d3343cd16c566be4b33e96c892c3e769951af (patch)
tree38c2742a39cdc4234fab4d89cf97f3bfa514e56b /Source/cmDependsC.cxx
parent7c61c73fbc1c508a6622b444e06c7fc9a0c280f1 (diff)
downloadCMake-551d3343cd16c566be4b33e96c892c3e769951af.zip
CMake-551d3343cd16c566be4b33e96c892c3e769951af.tar.gz
CMake-551d3343cd16c566be4b33e96c892c3e769951af.tar.bz2
cmDependsC: Collapse relative include paths
While calculating dependencies collapse sequences such as ../../../a/b/c/../../d/e/../../e/f to avoid total path lengths over the Windows path length limit as much as possible.
Diffstat (limited to 'Source/cmDependsC.cxx')
-rw-r--r--Source/cmDependsC.cxx18
1 files changed, 4 insertions, 14 deletions
diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx
index 43b7b8a..a252a1a 100644
--- a/Source/cmDependsC.cxx
+++ b/Source/cmDependsC.cxx
@@ -193,17 +193,8 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
// Construct the name of the file as if it were in the current
// include directory. Avoid using a leading "./".
- tempPathStr = "";
- if((*i) == ".")
- {
- tempPathStr += current.FileName;
- }
- else
- {
- tempPathStr += *i;
- tempPathStr+="/";
- tempPathStr+=current.FileName;
- }
+ tempPathStr =
+ cmSystemTools::CollapseCombinedPath(*i, current.FileName);
// Look for the file in this location.
if(cmSystemTools::FileExists(tempPathStr.c_str(), true))
@@ -458,9 +449,8 @@ void cmDependsC::Scan(std::istream& is, const char* directory,
// This was a double-quoted include with a relative path. We
// must check for the file in the directory containing the
// file we are scanning.
- entry.QuotedLocation = directory;
- entry.QuotedLocation += "/";
- entry.QuotedLocation += entry.FileName;
+ entry.QuotedLocation =
+ cmSystemTools::CollapseCombinedPath(directory, entry.FileName);
}
// Queue the file if it has not yet been encountered and it