From e7114226e6af60b9d214dba26d44648f530e4d96 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 3 Sep 2014 11:54:05 -0400 Subject: [PATCH 1/2] 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. --- Source/cmGlobalXCodeGenerator.cxx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 3503e19b9..f7c2e87fe 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -837,16 +837,14 @@ cmGlobalXCodeGenerator::CreateXCodeFileReferenceFromPath( cmTarget& cmtarget, const std::string &lang) { - std::string fname = fullpath; - cmXCodeObject* fileRef = this->FileRefs[fname]; + cmStdString 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.c_str()); + this->FileRefs[key] = fileRef; } - cmStdString key = GetGroupMapKeyFromPath(cmtarget, fullpath); cmXCodeObject* group = this->GroupMap[key]; cmXCodeObject* children = group->GetObject("children"); if (!children->HasObject(fileRef)) From cf92fe2d8428214464401aac12958846e101728a Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 3 Sep 2014 11:54:05 -0400 Subject: [PATCH 2/2] 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. --- Source/cmGlobalXCodeGenerator.cxx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index ee5fc009e..b598743d4 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))