[Cmake-commits] [cmake-commits] king committed cmLocalGenerator.cxx 1.286 1.287 cmLocalGenerator.h 1.106 1.107 cmLocalUnixMakefileGenerator3.cxx 1.255 1.256 cmLocalVisualStudio6Generator.cxx 1.149 1.150 cmLocalVisualStudio7Generator.cxx 1.234 1.235
cmake-commits at cmake.org
cmake-commits at cmake.org
Tue Dec 16 09:14:43 EST 2008
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv23898/Source
Modified Files:
cmLocalGenerator.cxx cmLocalGenerator.h
cmLocalUnixMakefileGenerator3.cxx
cmLocalVisualStudio6Generator.cxx
cmLocalVisualStudio7Generator.cxx
Log Message:
ENH: Refactor passing of max length object dir
When computing the maximum length full path to the build directory under
which object files will be placed, pass the actual path instead of just
its length. This will be useful for error message generation.
Index: cmLocalVisualStudio7Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio7Generator.cxx,v
retrieving revision 1.234
retrieving revision 1.235
diff -C 2 -d -r1.234 -r1.235
*** cmLocalVisualStudio7Generator.cxx 27 Oct 2008 19:31:03 -0000 1.234
--- cmLocalVisualStudio7Generator.cxx 16 Dec 2008 14:14:40 -0000 1.235
***************
*** 1227,1231 ****
cmSourceFile const& sf,
std::vector<std::string>* configs,
! std::string::size_type dir_len);
std::map<cmStdString, cmLVS7GFileConfig> FileConfigMap;
};
--- 1227,1231 ----
cmSourceFile const& sf,
std::vector<std::string>* configs,
! std::string const& dir_max);
std::map<cmStdString, cmLVS7GFileConfig> FileConfigMap;
};
***************
*** 1236,1245 ****
cmSourceFile const& sf,
std::vector<std::string>* configs,
! std::string::size_type dir_len)
{
std::string objectName;
if(lg->NeedObjectName.find(&sf) != lg->NeedObjectName.end())
{
! objectName = lg->GetObjectFileNameWithoutTarget(sf, dir_len);
}
--- 1236,1245 ----
cmSourceFile const& sf,
std::vector<std::string>* configs,
! std::string const& dir_max)
{
std::string objectName;
if(lg->NeedObjectName.find(&sf) != lg->NeedObjectName.end())
{
! objectName = lg->GetObjectFileNameWithoutTarget(sf, dir_max);
}
***************
*** 1359,1383 ****
}
! // Compute the maximum length of a configuration name.
! std::string::size_type config_len_max = 0;
for(std::vector<std::string>::iterator i = configs->begin();
i != configs->end(); ++i)
{
! if(i->size() > config_len_max)
{
! config_len_max = i->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 += this->GetTargetDirectory(target).size();
! dir_len += 1;
! dir_len += config_len_max;
! dir_len += 1;
// Loop through each source in the source group.
--- 1359,1383 ----
}
! // Compute the maximum length configuration name.
! std::string config_max;
for(std::vector<std::string>::iterator i = configs->begin();
i != configs->end(); ++i)
{
! if(i->size() > config_max.size())
{
! config_max = *i;
}
}
! // Compute the maximum length 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 dir_max;
! dir_max += this->Makefile->GetCurrentOutputDirectory();
! dir_max += "/";
! dir_max += this->GetTargetDirectory(target);
! dir_max += "/";
! dir_max += config_max;
! dir_max += "/";
// Loop through each source in the source group.
***************
*** 1387,1391 ****
{
std::string source = (*sf)->GetFullPath();
! FCInfo fcinfo(this, target, *(*sf), configs, dir_len);
if (source != libName || target.GetType() == cmTarget::UTILITY ||
--- 1387,1391 ----
{
std::string source = (*sf)->GetFullPath();
! FCInfo fcinfo(this, target, *(*sf), configs, dir_max);
if (source != libName || target.GetType() == cmTarget::UTILITY ||
Index: cmLocalGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.h,v
retrieving revision 1.106
retrieving revision 1.107
diff -C 2 -d -r1.106 -r1.107
*** cmLocalGenerator.h 9 Oct 2008 19:30:07 -0000 1.106
--- cmLocalGenerator.h 16 Dec 2008 14:14:40 -0000 1.107
***************
*** 341,348 ****
// Compute object file names.
std::string GetObjectFileNameWithoutTarget(const cmSourceFile& source,
! std::string::size_type dir_len,
bool* hasSourceExtension = 0);
std::string& CreateSafeUniqueObjectFileName(const char* sin,
! std::string::size_type dir_len);
void ConfigureRelativePaths();
--- 341,348 ----
// Compute object file names.
std::string GetObjectFileNameWithoutTarget(const cmSourceFile& source,
! std::string const& dir_max,
bool* hasSourceExtension = 0);
std::string& CreateSafeUniqueObjectFileName(const char* sin,
! std::string const& dir_max);
void ConfigureRelativePaths();
Index: cmLocalUnixMakefileGenerator3.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalUnixMakefileGenerator3.cxx,v
retrieving revision 1.255
retrieving revision 1.256
diff -C 2 -d -r1.255 -r1.256
*** cmLocalUnixMakefileGenerator3.cxx 9 Oct 2008 19:30:07 -0000 1.255
--- cmLocalUnixMakefileGenerator3.cxx 16 Dec 2008 14:14:40 -0000 1.256
***************
*** 1929,1938 ****
// Get the object file name without the target directory.
! std::string::size_type dir_len = 0;
! dir_len += strlen(this->Makefile->GetCurrentOutputDirectory());
! dir_len += 1;
! dir_len += obj.size();
std::string objectName =
! this->GetObjectFileNameWithoutTarget(source, dir_len,
hasSourceExtension);
if(nameWithoutTargetDir)
--- 1929,1938 ----
// Get the object file name without the target directory.
! std::string dir_max;
! dir_max += this->Makefile->GetCurrentOutputDirectory();
! dir_max += "/";
! dir_max += obj;
std::string objectName =
! this->GetObjectFileNameWithoutTarget(source, dir_max,
hasSourceExtension);
if(nameWithoutTargetDir)
Index: cmLocalVisualStudio6Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio6Generator.cxx,v
retrieving revision 1.149
retrieving revision 1.150
diff -C 2 -d -r1.149 -r1.150
*** cmLocalVisualStudio6Generator.cxx 10 Dec 2008 15:50:07 -0000 1.149
--- cmLocalVisualStudio6Generator.cxx 16 Dec 2008 14:14:40 -0000 1.150
***************
*** 373,378 ****
}
! // 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)
--- 373,378 ----
}
! // Compute the maximum length configuration name.
! std::string config_max;
for(std::vector<std::string>::iterator i = this->Configurations.begin();
i != this->Configurations.end(); ++i)
***************
*** 380,397 ****
// Strip the subdirectory name out of the configuration name.
std::string config = this->GetConfigName(*i);
! 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.
--- 380,397 ----
// Strip the subdirectory name out of the configuration name.
std::string config = this->GetConfigName(*i);
! if(config.size() > config_max.size())
{
! config_max = config;
}
}
! // Compute the maximum length 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 dir_max;
! dir_max += this->Makefile->GetCurrentOutputDirectory();
! dir_max += "/";
! dir_max += config_max;
! dir_max += "/";
// Loop through each source in the source group.
***************
*** 409,413 ****
objectNameDir =
cmSystemTools::GetFilenamePath(
! this->GetObjectFileNameWithoutTarget(*(*sf), dir_len));
}
--- 409,413 ----
objectNameDir =
cmSystemTools::GetFilenamePath(
! this->GetObjectFileNameWithoutTarget(*(*sf), dir_max));
}
Index: cmLocalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.cxx,v
retrieving revision 1.286
retrieving revision 1.287
diff -C 2 -d -r1.286 -r1.287
*** cmLocalGenerator.cxx 9 Oct 2008 19:30:07 -0000 1.286
--- cmLocalGenerator.cxx 16 Dec 2008 14:14:40 -0000 1.287
***************
*** 646,653 ****
!sf->GetPropertyAsBool("EXTERNAL_OBJECT"))
{
! std::string::size_type dir_len = 0;
! dir_len += strlen(this->Makefile->GetCurrentOutputDirectory());
! dir_len += 1;
! std::string obj = this->GetObjectFileNameWithoutTarget(*sf, dir_len);
if(!obj.empty())
{
--- 646,653 ----
!sf->GetPropertyAsBool("EXTERNAL_OBJECT"))
{
! std::string dir_max;
! dir_max += this->Makefile->GetCurrentOutputDirectory();
! dir_max += "/";
! std::string obj = this->GetObjectFileNameWithoutTarget(*sf, dir_max);
if(!obj.empty())
{
***************
*** 2476,2480 ****
cmLocalGenerator
::CreateSafeUniqueObjectFileName(const char* sin,
! std::string::size_type dir_len)
{
// Look for an existing mapped name for this object file.
--- 2476,2480 ----
cmLocalGenerator
::CreateSafeUniqueObjectFileName(const char* sin,
! std::string const& dir_max)
{
// Look for an existing mapped name for this object file.
***************
*** 2537,2543 ****
#if defined(CM_LG_ENCODE_OBJECT_NAMES)
! cmLocalGeneratorCheckObjectName(ssin, dir_len, this->ObjectPathMax);
#else
! (void)dir_len;
#endif
--- 2537,2544 ----
#if defined(CM_LG_ENCODE_OBJECT_NAMES)
! cmLocalGeneratorCheckObjectName(ssin, dir_max.size(),
! this->ObjectPathMax);
#else
! (void)dir_max;
#endif
***************
*** 2555,2559 ****
cmLocalGenerator
::GetObjectFileNameWithoutTarget(const cmSourceFile& source,
! std::string::size_type dir_len,
bool* hasSourceExtension)
{
--- 2556,2560 ----
cmLocalGenerator
::GetObjectFileNameWithoutTarget(const cmSourceFile& source,
! std::string const& dir_max,
bool* hasSourceExtension)
{
***************
*** 2643,2647 ****
// Convert to a safe name.
! return this->CreateSafeUniqueObjectFileName(objectName.c_str(), dir_len);
}
--- 2644,2648 ----
// Convert to a safe name.
! return this->CreateSafeUniqueObjectFileName(objectName.c_str(), dir_max);
}
More information about the Cmake-commits
mailing list