From c6c7f6fbeb5308bd9241e39df91025fd8a326992 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 24 Sep 2020 08:49:03 -0400 Subject: Xcode: Remove remnants of ancient XCODE_DEPEND_HELPER utility target The target has not been generated since commit d92d51429e (BUG: fix for bug 6193, fix xcode depend helper, 2008-01-10, v2.6.0~553). Remove it from the list of special targets. --- Source/cmGlobalXCodeGenerator.cxx | 9 ++++----- Source/cmGlobalXCodeGenerator.h | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index b2014e0..d6debcb 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1284,9 +1284,8 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeFileReference( bool cmGlobalXCodeGenerator::SpecialTargetEmitted(std::string const& tname) { - if (tname == "ALL_BUILD" || tname == "XCODE_DEPEND_HELPER" || - tname == "install" || tname == "package" || tname == "RUN_TESTS" || - tname == CMAKE_CHECK_BUILD_SYSTEM_TARGET) { + if (tname == "ALL_BUILD" || tname == "install" || tname == "package" || + tname == "RUN_TESTS" || tname == CMAKE_CHECK_BUILD_SYSTEM_TARGET) { if (this->TargetDoneSet.find(tname) != this->TargetDoneSet.end()) { return true; } @@ -3986,7 +3985,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects( for (auto t : targets) { this->AddDependAndLinkInformation(t); } - this->CreateXCodeDependHackTarget(targets); + this->CreateXCodeDependHackMakefile(targets); // now add all targets to the root object cmXCodeObject* allTargets = this->CreateObject(cmXCodeObject::OBJECT_LIST); for (auto t : targets) { @@ -4046,7 +4045,7 @@ void cmGlobalXCodeGenerator::ComputeObjectDirArch(cmMakefile* mf) } } -void cmGlobalXCodeGenerator::CreateXCodeDependHackTarget( +void cmGlobalXCodeGenerator::CreateXCodeDependHackMakefile( std::vector& targets) { cmGeneratedFileStream makefileStream(this->CurrentXCodeHackMakefile); diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index fca9c27..5b05214 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -227,7 +227,7 @@ private: std::vector&); bool IsHeaderFile(cmSourceFile*); void AddDependTarget(cmXCodeObject* target, cmXCodeObject* dependTarget); - void CreateXCodeDependHackTarget(std::vector& targets); + void CreateXCodeDependHackMakefile(std::vector& targets); bool SpecialTargetEmitted(std::string const& tname); void SetGenerationRoot(cmLocalGenerator* root); void AddExtraTargets(cmLocalGenerator* root, -- cgit v0.12 From 0a67c3ebe158a796ede2c754bff313d5c5b5f170 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 24 Sep 2020 08:52:53 -0400 Subject: Xcode: Remove dependency Makefile hacks under the "new build system" The original Xcode build system did not properly re-link targets that consumed object libraies. We worked around that with a post-build command on the object libraries themselves that removed their consumers if out of date. The "new build system" does not appear to need such help, so drop the workaround. --- Source/cmGlobalXCodeGenerator.cxx | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index d6debcb..b57bdbc 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -621,10 +621,14 @@ void cmGlobalXCodeGenerator::AddExtraTargets( root->AddGeneratorTarget(cm::make_unique(allbuild, root)); // Add XCODE depend helper - std::string dir = root->GetCurrentBinaryDirectory(); - cmCustomCommandLines commandLines = cmMakeSingleCommandLine( - { "make", "-C", dir, "-f", this->CurrentXCodeHackMakefile, - "OBJDIR=$(OBJDIR)", /* placeholder, see below */ "" }); + std::string legacyDependHelperDir = root->GetCurrentBinaryDirectory(); + cmCustomCommandLines legacyDependHelperCommandLines; + if (this->XcodeBuildSystem == BuildSystem::One) { + legacyDependHelperCommandLines = cmMakeSingleCommandLine( + { "make", "-C", legacyDependHelperDir, "-f", + this->CurrentXCodeHackMakefile, "OBJDIR=$(OBJDIR)", + /* placeholder, see below */ "" }); + } // Add ZERO_CHECK bool regenerate = !this->GlobalSettingIsOn("CMAKE_SUPPRESS_REGENERATION"); @@ -663,15 +667,15 @@ void cmGlobalXCodeGenerator::AddExtraTargets( // run the depend check makefile as a post build rule // this will make sure that when the next target is built // things are up-to-date - if (isGenerateProject && + if (this->XcodeBuildSystem == BuildSystem::One && isGenerateProject && target->GetType() == cmStateEnums::OBJECT_LIBRARY) { - commandLines.front().back() = // fill placeholder + legacyDependHelperCommandLines.front().back() = // fill placeholder this->PostBuildMakeTarget(target->GetName(), "$(CONFIGURATION)"); gen->AddCustomCommandToTarget( - target->GetName(), no_byproducts, no_depends, commandLines, - cmCustomCommandType::POST_BUILD, "Depend check for xcode", - dir.c_str(), true, false, "", "", false, - cmObjectLibraryCommands::Accept); + target->GetName(), no_byproducts, no_depends, + legacyDependHelperCommandLines, cmCustomCommandType::POST_BUILD, + "Depend check for xcode", legacyDependHelperDir.c_str(), true, false, + "", "", false, cmObjectLibraryCommands::Accept); } if (!this->IsExcluded(gens[0], target.get())) { @@ -3985,7 +3989,9 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects( for (auto t : targets) { this->AddDependAndLinkInformation(t); } - this->CreateXCodeDependHackMakefile(targets); + if (this->XcodeBuildSystem == BuildSystem::One) { + this->CreateXCodeDependHackMakefile(targets); + } // now add all targets to the root object cmXCodeObject* allTargets = this->CreateObject(cmXCodeObject::OBJECT_LIST); for (auto t : targets) { -- cgit v0.12