|
@@ -122,42 +122,22 @@ void
|
|
|
cmGlobalVisualStudioGenerator
|
|
cmGlobalVisualStudioGenerator
|
|
|
::ComputeTargetObjects(cmGeneratorTarget* gt) const
|
|
::ComputeTargetObjects(cmGeneratorTarget* gt) const
|
|
|
{
|
|
{
|
|
|
- cmLocalVisualStudioGenerator* lg =
|
|
|
|
|
- static_cast<cmLocalVisualStudioGenerator*>(gt->LocalGenerator);
|
|
|
|
|
- std::string dir_max = lg->ComputeLongestObjectDirectory(*gt->Target);
|
|
|
|
|
-
|
|
|
|
|
- // Count the number of object files with each name. Note that
|
|
|
|
|
- // windows file names are not case sensitive.
|
|
|
|
|
- std::map<std::string, int> counts;
|
|
|
|
|
std::vector<cmSourceFile const*> objectSources;
|
|
std::vector<cmSourceFile const*> objectSources;
|
|
|
gt->GetObjectSources(objectSources);
|
|
gt->GetObjectSources(objectSources);
|
|
|
- for(std::vector<cmSourceFile const*>::const_iterator
|
|
|
|
|
- si = objectSources.begin();
|
|
|
|
|
- si != objectSources.end(); ++si)
|
|
|
|
|
- {
|
|
|
|
|
- cmSourceFile const* sf = *si;
|
|
|
|
|
- std::string objectNameLower = cmSystemTools::LowerCase(
|
|
|
|
|
- cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath()));
|
|
|
|
|
- objectNameLower += ".obj";
|
|
|
|
|
- counts[objectNameLower] += 1;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // For all source files producing duplicate names we need unique
|
|
|
|
|
- // object name computation.
|
|
|
|
|
- for(std::vector<cmSourceFile const*>::const_iterator
|
|
|
|
|
- si = objectSources.begin();
|
|
|
|
|
- si != objectSources.end(); ++si)
|
|
|
|
|
- {
|
|
|
|
|
- cmSourceFile const* sf = *si;
|
|
|
|
|
- std::string objectName =
|
|
|
|
|
- cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath());
|
|
|
|
|
- objectName += ".obj";
|
|
|
|
|
- if(counts[cmSystemTools::LowerCase(objectName)] > 1)
|
|
|
|
|
- {
|
|
|
|
|
- gt->AddExplicitObjectName(sf);
|
|
|
|
|
- objectName = lg->GetObjectFileNameWithoutTarget(*sf, dir_max);
|
|
|
|
|
- }
|
|
|
|
|
- gt->AddObject(sf, objectName);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ std::map<cmSourceFile const*, std::string> mapping;
|
|
|
|
|
+ for(std::vector<cmSourceFile const*>::const_iterator it
|
|
|
|
|
+ = objectSources.begin(); it != objectSources.end(); ++it)
|
|
|
|
|
+ {
|
|
|
|
|
+ mapping[*it];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ gt->LocalGenerator->ComputeObjectFilenames(mapping, gt);
|
|
|
|
|
+
|
|
|
|
|
+ for(std::map<cmSourceFile const*, std::string>::const_iterator it
|
|
|
|
|
+ = mapping.begin(); it != mapping.end(); ++it)
|
|
|
|
|
+ {
|
|
|
|
|
+ gt->AddObject(it->first, it->second);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|