MCPcopy Create free account
hub / github.com/Kitware/CMake / ComputeObjectFilenames

Method ComputeObjectFilenames

Source/cmLocalXCodeGenerator.cxx:122–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122void cmLocalXCodeGenerator::ComputeObjectFilenames(
123 std::map<cmSourceFile const*, cmObjectLocations>& mapping,
124 std::string const& config,
125 cmGeneratorTarget const*)
126{
127 // Count the number of object files with each name. Warn about duplicate
128 // names since Xcode names them uniquely automatically with a numeric suffix
129 // to avoid exact duplicate file names. Note that Mac file names are not
130 // typically case sensitive, hence the LowerCase.
131 std::map<std::string, int> counts;
132 for (auto& si : mapping) {
133 cmSourceFile const* sf = si.first;
134 std::string shortObjectName = this->GetShortObjectFileName(*sf);
135 std::string longObjectName = cmStrCat(
136 cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath()), ".o");
137
138 std::string longObjectNameLower = cmSystemTools::LowerCase(longObjectName);
139 counts[longObjectNameLower] += 1;
140 if (2 == counts[longObjectNameLower]) {
141 // TODO: emit warning about duplicate name?
142 }
143 si.second.ShortLoc.emplace(shortObjectName);
144 si.second.LongLoc.Update(longObjectName);
145 this->FillCustomInstallObjectLocations(*sf, config, ".o", si.second.InstallLongLoc);
146 }
147}
148
149void cmLocalXCodeGenerator::AddXCConfigSources(cmGeneratorTarget* target)
150{

Callers

nothing calls this directly

Calls 6

emplaceMethod · 0.80
cmStrCatFunction · 0.70
GetFullPathMethod · 0.45
UpdateMethod · 0.45

Tested by

no test coverage detected