summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-09-03 11:54:05 -0400
committerBrad King <brad.king@kitware.com>2014-09-03 12:48:53 -0400
commitcf92fe2d8428214464401aac12958846e101728a (patch)
treea5b8e9c2957ab5f3d15d75f54f0e8887761d0d26 /Source
parentfb8acb74e83a591c1231c4a07c221f4392f4c0be (diff)
downloadcmake-cf92fe2d8428214464401aac12958846e101728a.tar.gz
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.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index ee5fc009ec..b598743d46 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -830,16 +830,14 @@ cmGlobalXCodeGenerator::CreateXCodeFileReferenceFromPath(
const std::string &lang,
cmSourceFile* sf)
{
- std::string fname = fullpath;
- cmXCodeObject* fileRef = this->FileRefs[fname];
+ std::string key = GetGroupMapKeyFromPath(cmtarget, fullpath);
+ cmXCodeObject* fileRef = this->FileRefs[key];
if(!fileRef)
{
fileRef = this->CreateObject(cmXCodeObject::PBXFileReference);
- std::string comment = fname;
- fileRef->SetComment(fname.c_str());
- this->FileRefs[fname] = fileRef;
+ fileRef->SetComment(fullpath);
+ this->FileRefs[key] = fileRef;
}
- std::string key = GetGroupMapKeyFromPath(cmtarget, fullpath);
cmXCodeObject* group = this->GroupMap[key];
cmXCodeObject* children = group->GetObject("children");
if (!children->HasObject(fileRef))