mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-07 06:09:52 -06:00
cmGlobalXCodeGenerator: Adopt pbxproj object id generation
This commit is contained in:
@@ -40,7 +40,7 @@ cmXCodeObject::~cmXCodeObject()
|
||||
this->Version = 15;
|
||||
}
|
||||
|
||||
cmXCodeObject::cmXCodeObject(PBXType ptype, Type type)
|
||||
cmXCodeObject::cmXCodeObject(PBXType ptype, Type type, std::string id)
|
||||
{
|
||||
this->Version = 15;
|
||||
this->Target = nullptr;
|
||||
@@ -48,27 +48,7 @@ cmXCodeObject::cmXCodeObject(PBXType ptype, Type type)
|
||||
|
||||
this->IsA = ptype;
|
||||
|
||||
if (type == OBJECT) {
|
||||
// Set the Id of an Xcode object to a unique string for each instance.
|
||||
// However the Xcode user file references certain Ids: for those cases,
|
||||
// override the generated Id using SetId().
|
||||
//
|
||||
char cUuid[40] = { 0 };
|
||||
CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault);
|
||||
CFStringRef s = CFUUIDCreateString(kCFAllocatorDefault, uuid);
|
||||
CFStringGetCString(s, cUuid, sizeof(cUuid), kCFStringEncodingUTF8);
|
||||
this->Id = cUuid;
|
||||
CFRelease(s);
|
||||
CFRelease(uuid);
|
||||
} else {
|
||||
this->Id =
|
||||
"Temporary cmake object, should not be referred to in Xcode file";
|
||||
}
|
||||
|
||||
cmSystemTools::ReplaceString(this->Id, "-", "");
|
||||
if (this->Id.size() > 24) {
|
||||
this->Id = this->Id.substr(0, 24);
|
||||
}
|
||||
this->Id = std::move(id);
|
||||
|
||||
this->TypeValue = type;
|
||||
if (this->TypeValue == OBJECT) {
|
||||
|
||||
Reference in New Issue
Block a user