MCPcopy Create free account
hub / github.com/Kitware/CMake / AppendBuildSettingAttribute

Method AppendBuildSettingAttribute

Source/cmGlobalXCodeGenerator.cxx:3666–3699  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3664}
3665
3666void cmGlobalXCodeGenerator::AppendBuildSettingAttribute(
3667 cmXCodeObject* settings, char const* attribute, cmXCodeObject* attr,
3668 cmXCodeObject* value)
3669{
3670 if (value->GetType() != cmXCodeObject::OBJECT_LIST &&
3671 value->GetType() != cmXCodeObject::STRING) {
3672 cmSystemTools::Error(
3673 cmStrCat("Unsupported value type for appending: ", attribute));
3674 return;
3675 }
3676 if (attr->GetType() == cmXCodeObject::OBJECT_LIST) {
3677 if (value->GetType() == cmXCodeObject::OBJECT_LIST) {
3678 for (auto* obj : value->GetObjectList()) {
3679 attr->AddObject(obj);
3680 }
3681 } else {
3682 attr->AddObject(value);
3683 }
3684 } else if (attr->GetType() == cmXCodeObject::STRING) {
3685 if (value->GetType() == cmXCodeObject::OBJECT_LIST) {
3686 // Add old value as a list item to new object list
3687 // and replace the attribute with the new list
3688 value->PrependObject(attr);
3689 settings->AddAttribute(attribute, value);
3690 } else {
3691 std::string newValue =
3692 cmStrCat(attr->GetString(), ' ', value->GetString());
3693 attr->SetString(newValue);
3694 }
3695 } else {
3696 cmSystemTools::Error(
3697 cmStrCat("Unsupported attribute type for appending: ", attribute));
3698 }
3699}
3700
3701void cmGlobalXCodeGenerator::AppendBuildSettingAttribute(
3702 cmXCodeObject* target, char const* attribute, cmXCodeObject* value,

Calls 12

AddObjectMethod · 0.80
PrependObjectMethod · 0.80
GetObjectMethod · 0.80
ErrorClass · 0.70
cmStrCatFunction · 0.70
GetTypeMethod · 0.45
AddAttributeMethod · 0.45
GetStringMethod · 0.45
SetStringMethod · 0.45
GetAttributeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected