Xcode: Always track object library dependencies via hacky Makefile

Always use the dependency tracker Makefile to ensure targets that
depend on object libraries are up-to-date.  For all other target
types we use the hack only for Xcode < 5.

Fixes: #16615
This commit is contained in:
Gregor Jasny
2017-02-18 18:43:25 +01:00
committed by Brad King
parent e80ac95303
commit 5da9266af5
+12 -14
View File
@@ -423,14 +423,12 @@ void cmGlobalXCodeGenerator::AddExtraTargets(
// Add XCODE depend helper // Add XCODE depend helper
std::string dir = root->GetCurrentBinaryDirectory(); std::string dir = root->GetCurrentBinaryDirectory();
cmCustomCommandLine makeHelper; cmCustomCommandLine makeHelper;
if (this->XcodeVersion < 50) { makeHelper.push_back("make");
makeHelper.push_back("make"); makeHelper.push_back("-C");
makeHelper.push_back("-C"); makeHelper.push_back(dir);
makeHelper.push_back(dir); makeHelper.push_back("-f");
makeHelper.push_back("-f"); makeHelper.push_back(this->CurrentXCodeHackMakefile);
makeHelper.push_back(this->CurrentXCodeHackMakefile); makeHelper.push_back(""); // placeholder, see below
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");
@@ -475,12 +473,12 @@ void cmGlobalXCodeGenerator::AddExtraTargets(
// 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 (!makeHelper.empty() && if (target->GetType() == cmStateEnums::OBJECT_LIBRARY ||
(target->GetType() == cmStateEnums::EXECUTABLE || (this->XcodeVersion < 50 &&
target->GetType() == cmStateEnums::OBJECT_LIBRARY || (target->GetType() == cmStateEnums::EXECUTABLE ||
target->GetType() == cmStateEnums::STATIC_LIBRARY || target->GetType() == cmStateEnums::STATIC_LIBRARY ||
target->GetType() == cmStateEnums::SHARED_LIBRARY || target->GetType() == cmStateEnums::SHARED_LIBRARY ||
target->GetType() == cmStateEnums::MODULE_LIBRARY)) { target->GetType() == cmStateEnums::MODULE_LIBRARY))) {
makeHelper[makeHelper.size() - 1] = // fill placeholder makeHelper[makeHelper.size() - 1] = // fill placeholder
this->PostBuildMakeTarget(target->GetName(), "$(CONFIGURATION)"); this->PostBuildMakeTarget(target->GetName(), "$(CONFIGURATION)");
cmCustomCommandLines commandLines; cmCustomCommandLines commandLines;