Commit 63d1be8b authored by David Cole's avatar David Cole Committed by Brad King
Browse files

Xcode: Honor $<TARGET_OBJECTS:...> source expressions

Add objects from object libraries referenced using this syntax to the
set of objects linked in a target.
parent 020ba387
...@@ -295,6 +295,10 @@ void cmGlobalXCodeGenerator::Generate() ...@@ -295,6 +295,10 @@ void cmGlobalXCodeGenerator::Generate()
} }
this->ForceLinkerLanguages(); this->ForceLinkerLanguages();
this->cmGlobalGenerator::Generate(); this->cmGlobalGenerator::Generate();
if(cmSystemTools::GetErrorOccuredFlag())
{
return;
}
for(it = this->ProjectMap.begin(); it!= this->ProjectMap.end(); ++it) for(it = this->ProjectMap.begin(); it!= this->ProjectMap.end(); ++it)
{ {
cmLocalGenerator* root = it->second[0]; cmLocalGenerator* root = it->second[0];
...@@ -945,6 +949,20 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, ...@@ -945,6 +949,20 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
} }
} }
// Add object library contents as external objects. (Equivalent to
// the externalObjFiles above, except each one is not a cmSourceFile
// within the target.)
std::vector<std::string> objs;
this->GetGeneratorTarget(&cmtarget)->UseObjectLibraries(objs);
for(std::vector<std::string>::const_iterator
oi = objs.begin(); oi != objs.end(); ++oi)
{
std::string obj = *oi;
cmXCodeObject* xsf =
this->CreateXCodeSourceFileFromPath(obj, cmtarget, "");
externalObjFiles.push_back(xsf);
}
// some build phases only apply to bundles and/or frameworks // some build phases only apply to bundles and/or frameworks
bool isFrameworkTarget = cmtarget.IsFrameworkOnApple(); bool isFrameworkTarget = cmtarget.IsFrameworkOnApple();
bool isBundleTarget = cmtarget.GetPropertyAsBool("MACOSX_BUNDLE"); bool isBundleTarget = cmtarget.GetPropertyAsBool("MACOSX_BUNDLE");
...@@ -2719,6 +2737,21 @@ void cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root, ...@@ -2719,6 +2737,21 @@ void cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root,
cmStdString key = GetGroupMapKey(cmtarget, sf); cmStdString key = GetGroupMapKey(cmtarget, sf);
this->GroupMap[key] = pbxgroup; this->GroupMap[key] = pbxgroup;
} }
// Put OBJECT_LIBRARY objects in proper groups:
std::vector<std::string> objs;
this->GetGeneratorTarget(&cmtarget)->UseObjectLibraries(objs);
for(std::vector<std::string>::const_iterator
oi = objs.begin(); oi != objs.end(); ++oi)
{
std::string const& source = *oi;
cmSourceGroup& sourceGroup =
mf->FindSourceGroup(source.c_str(), sourceGroups);
cmXCodeObject* pbxgroup =
this->CreateOrGetPBXGroup(cmtarget, &sourceGroup);
cmStdString key = GetGroupMapKeyFromPath(cmtarget, source);
this->GroupMap[key] = pbxgroup;
}
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment