diff options
-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) { |