summaryrefslogtreecommitdiffstats
path: root/Source/cmXCodeObject.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-01-06 20:29:24 (GMT)
committerBrad King <brad.king@kitware.com>2021-01-06 21:21:53 (GMT)
commitd250b67722abcfe1bcd22511943f3e032ef1ef3d (patch)
treeb23b82a7dc28a2197cf765a92c8985486140a8c4 /Source/cmXCodeObject.cxx
parent95e3ff2e88aa8dd984915e6e0373eed2bb96f17f (diff)
downloadCMake-d250b67722abcfe1bcd22511943f3e032ef1ef3d.zip
CMake-d250b67722abcfe1bcd22511943f3e032ef1ef3d.tar.gz
CMake-d250b67722abcfe1bcd22511943f3e032ef1ef3d.tar.bz2
cmGlobalXCodeGenerator: Adopt pbxproj object id generation
Diffstat (limited to 'Source/cmXCodeObject.cxx')
-rw-r--r--Source/cmXCodeObject.cxx24
1 files changed, 2 insertions, 22 deletions
diff --git a/Source/cmXCodeObject.cxx b/Source/cmXCodeObject.cxx
index b301ab1..d5c5275 100644
--- a/Source/cmXCodeObject.cxx
+++ b/Source/cmXCodeObject.cxx
@@ -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) {