Xcode: Generate per-target file references (#15111)
Xcode requires a separate PBXFileReference for each target source group that references a source file. Xcode 6 now diagnoses re-use of the same PBXFileReference from multiple source groups. Add the referencing target name to our internal map key so we use a per-target reference.
This commit is contained in:
parent
fb8acb74e8
commit
cf92fe2d84
|
@ -830,16 +830,14 @@ cmGlobalXCodeGenerator::CreateXCodeFileReferenceFromPath(
|
||||||
const std::string &lang,
|
const std::string &lang,
|
||||||
cmSourceFile* sf)
|
cmSourceFile* sf)
|
||||||
{
|
{
|
||||||
std::string fname = fullpath;
|
std::string key = GetGroupMapKeyFromPath(cmtarget, fullpath);
|
||||||
cmXCodeObject* fileRef = this->FileRefs[fname];
|
cmXCodeObject* fileRef = this->FileRefs[key];
|
||||||
if(!fileRef)
|
if(!fileRef)
|
||||||
{
|
{
|
||||||
fileRef = this->CreateObject(cmXCodeObject::PBXFileReference);
|
fileRef = this->CreateObject(cmXCodeObject::PBXFileReference);
|
||||||
std::string comment = fname;
|
fileRef->SetComment(fullpath);
|
||||||
fileRef->SetComment(fname.c_str());
|
this->FileRefs[key] = fileRef;
|
||||||
this->FileRefs[fname] = fileRef;
|
|
||||||
}
|
}
|
||||||
std::string key = GetGroupMapKeyFromPath(cmtarget, fullpath);
|
|
||||||
cmXCodeObject* group = this->GroupMap[key];
|
cmXCodeObject* group = this->GroupMap[key];
|
||||||
cmXCodeObject* children = group->GetObject("children");
|
cmXCodeObject* children = group->GetObject("children");
|
||||||
if (!children->HasObject(fileRef))
|
if (!children->HasObject(fileRef))
|
||||||
|
|
Loading…
Reference in New Issue