summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalXCodeGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmLocalXCodeGenerator.cxx')
-rw-r--r--Source/cmLocalXCodeGenerator.cxx34
1 files changed, 31 insertions, 3 deletions
diff --git a/Source/cmLocalXCodeGenerator.cxx b/Source/cmLocalXCodeGenerator.cxx
index a9a27b9..8ff6c87 100644
--- a/Source/cmLocalXCodeGenerator.cxx
+++ b/Source/cmLocalXCodeGenerator.cxx
@@ -37,7 +37,7 @@ cmLocalXCodeGenerator::GetTargetDirectory(cmTarget const&) const
//----------------------------------------------------------------------------
void cmLocalXCodeGenerator::AppendFlagEscape(std::string& flags,
- const char* rawFlag)
+ const std::string& rawFlag)
{
cmGlobalXCodeGenerator* gg =
static_cast<cmGlobalXCodeGenerator*>(this->GlobalGenerator);
@@ -54,7 +54,7 @@ void cmLocalXCodeGenerator::Generate()
iter != targets.end(); ++iter)
{
cmTarget* t = &iter->second;
- t->HasMacOSXRpathInstallNameDir(NULL);
+ t->HasMacOSXRpathInstallNameDir("");
}
}
@@ -68,6 +68,34 @@ void cmLocalXCodeGenerator::GenerateInstallRules()
iter != targets.end(); ++iter)
{
cmTarget* t = &iter->second;
- t->HasMacOSXRpathInstallNameDir(NULL);
+ t->HasMacOSXRpathInstallNameDir("");
+ }
+}
+
+//----------------------------------------------------------------------------
+void cmLocalXCodeGenerator::ComputeObjectFilenames(
+ std::map<cmSourceFile const*, std::string>& mapping,
+ cmGeneratorTarget 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;
+ for(std::map<cmSourceFile const*, std::string>::iterator
+ si = mapping.begin(); si != mapping.end(); ++si)
+ {
+ cmSourceFile const* sf = si->first;
+ std::string objectName =
+ cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath());
+ objectName += ".o";
+
+ std::string objectNameLower = cmSystemTools::LowerCase(objectName);
+ counts[objectNameLower] += 1;
+ if (2 == counts[objectNameLower])
+ {
+ // TODO: emit warning about duplicate name?
+ }
+ si->second = objectName;
}
}