Selaa lähdekoodia

Merge topic 'xcode-duplicate-file-refs'

d73f8828 Merge branch 'backport-xcode-duplicate-file-refs' into xcode-duplicate-file-refs
cf92fe2d Xcode: Generate per-target file references (#15111)
e7114226 Xcode: Generate per-target file references (#15111)
Brad King 11 vuotta sitten
vanhempi
sitoutus
f7c44eac4c
1 muutettua tiedostoa jossa 4 lisäystä ja 6 poistoa
  1. 4 6
      Source/cmGlobalXCodeGenerator.cxx

+ 4 - 6
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))