ソースを参照

Merge branch 'backport-xcode-duplicate-file-refs' into release

Brad King 11 年 前
コミット
a1eb90c85d
1 ファイル変更4 行追加6 行削除
  1. 4 6
      Source/cmGlobalXCodeGenerator.cxx

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