| 
					
				 | 
			
			
				@@ -810,7 +810,6 @@ void cmGlobalXCodeGenerator::ClearXCodeObjects() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   this->TargetGroup.clear(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   this->FileRefs.clear(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   this->ExternalLibRefs.clear(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  this->EmbeddedLibRefs.clear(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   this->FileRefToBuildFileMap.clear(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   this->FileRefToEmbedBuildFileMap.clear(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   this->CommandsVisited.clear(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -4245,24 +4244,18 @@ void cmGlobalXCodeGenerator::AddEmbeddedObjects( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                cmSystemTools::IsPathToMacOSSharedLibrary(relFile) || 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                cmSystemTools::FileIsDirectory(filePath)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       // This is a regular string path - create file reference 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      auto it = this->EmbeddedLibRefs.find(relFile); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      if (it == this->EmbeddedLibRefs.end()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        cmXCodeObject* fileRef = 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          this->CreateXCodeFileReferenceFromPath(relFile, gt, "", nullptr); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (fileRef) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          buildFile = this->CreateObject(cmXCodeObject::PBXBuildFile); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          buildFile->SetComment(fileRef->GetComment()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          buildFile->AddAttribute("fileRef", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                                  this->CreateObjectReference(fileRef)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (!buildFile) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          cmSystemTools::Error( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            cmStrCat("Can't create build file for ", relFile)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        this->EmbeddedLibRefs.emplace(filePath, buildFile); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        buildFile = it->second; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      cmXCodeObject* fileRef = 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this->CreateXCodeFileReferenceFromPath(relFile, gt, "", nullptr); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      if (fileRef) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        buildFile = this->CreateObject(cmXCodeObject::PBXBuildFile); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        buildFile->SetComment(fileRef->GetComment()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        buildFile->AddAttribute("fileRef", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                this->CreateObjectReference(fileRef)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      if (!buildFile) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        cmSystemTools::Error( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          cmStrCat("Can't create build file for ", relFile)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (!buildFile) { 
			 |