summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-03-11 16:37:26 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-03-13 14:28:02 (GMT)
commitf6da044080d854b9ad87cef5c2a6f5195722a6da (patch)
tree9272911eaf9625896c75a8ccf0ad52560b0e6f48 /Source/cmGlobalXCodeGenerator.cxx
parent9ad804ac7be18efb92040434808f89174586b13d (diff)
downloadCMake-f6da044080d854b9ad87cef5c2a6f5195722a6da.zip
CMake-f6da044080d854b9ad87cef5c2a6f5195722a6da.tar.gz
CMake-f6da044080d854b9ad87cef5c2a6f5195722a6da.tar.bz2
cmLocalGenerator: Add ComputeObjectFilenames interface.
Implement it in the local generators and use it in the global generators.
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx30
1 files changed, 11 insertions, 19 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 4904d51..0a4b51c 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -3939,30 +3939,22 @@ void
cmGlobalXCodeGenerator
::ComputeTargetObjects(cmGeneratorTarget* gt) const
{
- // Count the number of object files with each name. Warn about duplicate
- // names since Xcode names them uniquely automatically with a numeric suffix
- // to avoid exact duplicate file names. Note that Mac file names are not
- // typically case sensitive, hence the LowerCase.
- std::map<std::string, int> counts;
std::vector<cmSourceFile const*> objectSources;
gt->GetObjectSources(objectSources);
- for(std::vector<cmSourceFile const*>::const_iterator
- si = objectSources.begin();
- si != objectSources.end(); ++si)
+
+ std::map<cmSourceFile const*, std::string> mapping;
+ for(std::vector<cmSourceFile const*>::const_iterator it
+ = objectSources.begin(); it != objectSources.end(); ++it)
{
- cmSourceFile const* sf = *si;
- std::string objectName =
- cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath());
- objectName += ".o";
+ mapping[*it];
+ }
- std::string objectNameLower = cmSystemTools::LowerCase(objectName);
- counts[objectNameLower] += 1;
- if (2 == counts[objectNameLower])
- {
- // TODO: emit warning about duplicate name?
- }
+ gt->LocalGenerator->ComputeObjectFilenames(mapping, gt);
- gt->AddObject(sf, objectName);
+ for(std::map<cmSourceFile const*, std::string>::const_iterator it
+ = mapping.begin(); it != mapping.end(); ++it)
+ {
+ gt->AddObject(it->first, it->second);
}
}