| 3664 | } |
| 3665 | |
| 3666 | void 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 | |
| 3701 | void cmGlobalXCodeGenerator::AppendBuildSettingAttribute( |
| 3702 | cmXCodeObject* target, char const* attribute, cmXCodeObject* value, |
no test coverage detected