Xcode: Inline relevant parts of UseObjectLibraries

This commit is contained in:
Brad King
2017-04-12 15:11:57 -04:00
parent 1afacebee9
commit 63fbf58750

View File

@@ -1051,11 +1051,14 @@ bool cmGlobalXCodeGenerator::CreateXCodeTargets(
// Add object library contents as external objects. (Equivalent to // Add object library contents as external objects. (Equivalent to
// the externalObjFiles above, except each one is not a cmSourceFile // the externalObjFiles above, except each one is not a cmSourceFile
// within the target.) // within the target.)
std::vector<std::string> objs; std::vector<cmSourceFile const*> objs;
gtgt->UseObjectLibraries(objs, ""); gtgt->GetExternalObjects(objs, "");
for (std::vector<std::string>::const_iterator oi = objs.begin(); for (std::vector<cmSourceFile const*>::const_iterator oi = objs.begin();
oi != objs.end(); ++oi) { oi != objs.end(); ++oi) {
std::string obj = *oi; if ((*oi)->GetObjectLibrary().empty()) {
continue;
}
std::string const& obj = (*oi)->GetFullPath();
cmXCodeObject* xsf = cmXCodeObject* xsf =
this->CreateXCodeSourceFileFromPath(obj, gtgt, "", 0); this->CreateXCodeSourceFileFromPath(obj, gtgt, "", 0);
externalObjFiles.push_back(xsf); externalObjFiles.push_back(xsf);
@@ -2669,13 +2672,16 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
// Add object library contents as link flags. // Add object library contents as link flags.
std::string linkObjs; std::string linkObjs;
const char* sep = ""; const char* sep = "";
std::vector<std::string> objs; std::vector<cmSourceFile const*> objs;
gt->UseObjectLibraries(objs, ""); gt->GetExternalObjects(objs, "");
for (std::vector<std::string>::const_iterator oi = objs.begin(); for (std::vector<cmSourceFile const*>::const_iterator oi = objs.begin();
oi != objs.end(); ++oi) { oi != objs.end(); ++oi) {
if ((*oi)->GetObjectLibrary().empty()) {
continue;
}
linkObjs += sep; linkObjs += sep;
sep = " "; sep = " ";
linkObjs += this->XCodeEscapePath(*oi); linkObjs += this->XCodeEscapePath((*oi)->GetFullPath());
} }
this->AppendBuildSettingAttribute( this->AppendBuildSettingAttribute(
target, this->GetTargetLinkFlagsVar(gt), linkObjs.c_str(), configName); target, this->GetTargetLinkFlagsVar(gt), linkObjs.c_str(), configName);
@@ -2801,11 +2807,15 @@ bool cmGlobalXCodeGenerator::CreateGroups(
if (this->XcodeVersion < 50) { if (this->XcodeVersion < 50) {
// Put OBJECT_LIBRARY objects in proper groups: // Put OBJECT_LIBRARY objects in proper groups:
std::vector<std::string> objs; std::vector<cmSourceFile const*> objs;
gtgt->UseObjectLibraries(objs, ""); gtgt->GetExternalObjects(objs, "");
for (std::vector<std::string>::const_iterator oi = objs.begin(); for (std::vector<cmSourceFile const*>::const_iterator oi =
objs.begin();
oi != objs.end(); ++oi) { oi != objs.end(); ++oi) {
std::string const& source = *oi; if ((*oi)->GetObjectLibrary().empty()) {
continue;
}
std::string const& source = (*oi)->GetFullPath();
cmSourceGroup* sourceGroup = cmSourceGroup* sourceGroup =
mf->FindSourceGroup(source.c_str(), sourceGroups); mf->FindSourceGroup(source.c_str(), sourceGroups);
cmXCodeObject* pbxgroup = cmXCodeObject* pbxgroup =