Xcode: Drop XCODE_DEPEND_HELPER for Xcode >= 5

Xcode 5.0 now computes dependencies from files linked through
OTHER_LDFLAGS, so we no longer need the XCODE_DEPEND_HELPER hack to
re-link dependents when targets change.
This commit is contained in:
Brad King 2013-10-02 11:39:22 -04:00
parent 118032247c
commit dff8d113b4
1 changed files with 19 additions and 12 deletions

View File

@ -431,13 +431,16 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
// Add XCODE depend helper // Add XCODE depend helper
std::string dir = mf->GetCurrentOutputDirectory(); std::string dir = mf->GetCurrentOutputDirectory();
cmCustomCommandLine makecommand; cmCustomCommandLine makeHelper;
makecommand.push_back("make"); if(this->XcodeVersion < 50)
makecommand.push_back("-C"); {
makecommand.push_back(dir.c_str()); makeHelper.push_back("make");
makecommand.push_back("-f"); makeHelper.push_back("-C");
makecommand.push_back(this->CurrentXCodeHackMakefile.c_str()); makeHelper.push_back(dir.c_str());
makecommand.push_back(""); // placeholder, see below makeHelper.push_back("-f");
makeHelper.push_back(this->CurrentXCodeHackMakefile.c_str());
makeHelper.push_back(""); // placeholder, see below
}
// Add ZERO_CHECK // Add ZERO_CHECK
bool regenerate = !mf->IsOn("CMAKE_SUPPRESS_REGENERATION"); bool regenerate = !mf->IsOn("CMAKE_SUPPRESS_REGENERATION");
@ -477,17 +480,18 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
// run the depend check makefile as a post build rule // run the depend check makefile as a post build rule
// this will make sure that when the next target is built // this will make sure that when the next target is built
// things are up-to-date // things are up-to-date
if((target.GetType() == cmTarget::EXECUTABLE || if(!makeHelper.empty() &&
(target.GetType() == cmTarget::EXECUTABLE ||
// Nope - no post-build for OBJECT_LIRBRARY // Nope - no post-build for OBJECT_LIRBRARY
// target.GetType() == cmTarget::OBJECT_LIBRARY || // target.GetType() == cmTarget::OBJECT_LIBRARY ||
target.GetType() == cmTarget::STATIC_LIBRARY || target.GetType() == cmTarget::STATIC_LIBRARY ||
target.GetType() == cmTarget::SHARED_LIBRARY || target.GetType() == cmTarget::SHARED_LIBRARY ||
target.GetType() == cmTarget::MODULE_LIBRARY)) target.GetType() == cmTarget::MODULE_LIBRARY))
{ {
makecommand[makecommand.size()-1] = makeHelper[makeHelper.size()-1] = // fill placeholder
this->PostBuildMakeTarget(target.GetName(), "$(CONFIGURATION)"); this->PostBuildMakeTarget(target.GetName(), "$(CONFIGURATION)");
cmCustomCommandLines commandLines; cmCustomCommandLines commandLines;
commandLines.push_back(makecommand); commandLines.push_back(makeHelper);
lg->GetMakefile()->AddCustomCommandToTarget(target.GetName(), lg->GetMakefile()->AddCustomCommandToTarget(target.GetName(),
no_depends, no_depends,
commandLines, commandLines,
@ -3338,8 +3342,11 @@ void cmGlobalXCodeGenerator
cmXCodeObject* t = *i; cmXCodeObject* t = *i;
this->AddDependAndLinkInformation(t); this->AddDependAndLinkInformation(t);
} }
if(this->XcodeVersion < 50)
{
// now create xcode depend hack makefile // now create xcode depend hack makefile
this->CreateXCodeDependHackTarget(targets); this->CreateXCodeDependHackTarget(targets);
}
// now add all targets to the root object // now add all targets to the root object
cmXCodeObject* allTargets = this->CreateObject(cmXCodeObject::OBJECT_LIST); cmXCodeObject* allTargets = this->CreateObject(cmXCodeObject::OBJECT_LIST);
for(std::vector<cmXCodeObject*>::iterator i = targets.begin(); for(std::vector<cmXCodeObject*>::iterator i = targets.begin();