diff options
author | Brad King <brad.king@kitware.com> | 2020-09-24 12:52:53 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-09-24 18:53:28 (GMT) |
commit | 0a67c3ebe158a796ede2c754bff313d5c5b5f170 (patch) | |
tree | 5798aa7f0a5ebdf401a25cb28b541aa280b27d19 /Source/cmGlobalXCodeGenerator.cxx | |
parent | c6c7f6fbeb5308bd9241e39df91025fd8a326992 (diff) | |
download | CMake-0a67c3ebe158a796ede2c754bff313d5c5b5f170.zip CMake-0a67c3ebe158a796ede2c754bff313d5c5b5f170.tar.gz CMake-0a67c3ebe158a796ede2c754bff313d5c5b5f170.tar.bz2 |
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.
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 28 |
1 files 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<cmGeneratorTarget>(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) { |