diff options
Diffstat (limited to 'Source/cmLocalVisualStudio6Generator.cxx')
-rw-r--r-- | Source/cmLocalVisualStudio6Generator.cxx | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index 6a24b01..3a72de6 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -397,7 +397,32 @@ void cmLocalVisualStudio6Generator { this->WriteDSPBeginGroup(fout, name.c_str(), ""); } - + + // Compute the maximum length of a configuration name. + std::string::size_type config_len_max = 0; + for(std::vector<std::string>::iterator i = this->Configurations.begin(); + i != this->Configurations.end(); ++i) + { + // Strip the subdirectory name out of the configuration name. + std::string config = *i; + std::string::size_type pos = config.find_last_of(" "); + config = config.substr(pos+1, std::string::npos); + config = config.substr(0, config.size()-1); + if(config.size() > config_len_max) + { + config_len_max = config.size(); + } + } + + // Compute the maximum length of the full path to the intermediate + // files directory for any configuration. This is used to construct + // object file names that do not produce paths that are too long. + std::string::size_type dir_len = 0; + dir_len += strlen(this->Makefile->GetCurrentOutputDirectory()); + dir_len += 1; + dir_len += config_len_max; + dir_len += 1; + // Loop through each source in the source group. for(std::vector<const cmSourceFile *>::const_iterator sf = sourceFiles.begin(); sf != sourceFiles.end(); ++sf) @@ -412,7 +437,7 @@ void cmLocalVisualStudio6Generator { objectNameDir = cmSystemTools::GetFilenamePath( - this->GetObjectFileNameWithoutTarget(*(*sf))); + this->GetObjectFileNameWithoutTarget(*(*sf), dir_len)); } // Add per-source file flags. |