diff options
author | Brad King <brad.king@kitware.com> | 2006-04-20 19:28:56 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-04-20 19:28:56 (GMT) |
commit | 350c3efe7bde6d1cd3e24a309f8c1d9671699a16 (patch) | |
tree | f6536af75c1901ab816b75cd28ceb7c26a760da5 /Source/cmLocalVisualStudio7Generator.cxx | |
parent | 31875743e99f0e10c2a4c5e9c446bd46984dac90 (diff) | |
download | CMake-350c3efe7bde6d1cd3e24a309f8c1d9671699a16.zip CMake-350c3efe7bde6d1cd3e24a309f8c1d9671699a16.tar.gz CMake-350c3efe7bde6d1cd3e24a309f8c1d9671699a16.tar.bz2 |
BUG: VS7 seems to have a limit on the length of the link directory list string. Try to make the string as short as possible by avoiding trailing slashes and using a relative path (if it is shorter).
Diffstat (limited to 'Source/cmLocalVisualStudio7Generator.cxx')
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 1f40847..03bc74b 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -864,18 +864,32 @@ cmLocalVisualStudio7Generator for(std::vector<cmStdString>::const_iterator d = dirs.begin(); d != dirs.end(); ++d) { + // Remove any trailing slash and skip empty paths. std::string dir = *d; - if(!dir.empty()) + if(dir[dir.size()-1] == '/') { - if(dir[dir.size()-1] != '/') + dir = dir.substr(0, dir.size()-1); + } + if(dir.empty()) + { + continue; + } + + // Switch to a relative path specification if it is shorter. + if(cmSystemTools::FileIsFullPath(dir.c_str())) + { + std::string rel = this->Convert(dir.c_str(), START_OUTPUT, UNCHANGED); + if(rel.size() < dir.size()) { - dir += "/"; + dir = rel; } - dir += "$(OutDir)"; - fout << comma << this->ConvertToXMLOutputPath(dir.c_str()) - << "," << this->ConvertToXMLOutputPath(d->c_str()); - comma = ","; } + + // First search a configuration-specific subdirectory and then the + // original directory. + fout << comma << this->ConvertToXMLOutputPath((dir+"/$(OutDir)").c_str()) + << "," << this->ConvertToXMLOutputPath(dir.c_str()); + comma = ","; } } |