summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-09-25 16:23:43 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-09-25 16:23:48 (GMT)
commit7b4861b0823529233ec43ab394dffde9cce1188d (patch)
treec63af153766cc8d18a95368a5fdbf3bd67e465d7 /Source
parentef26161bae8286703aa105cee6639cf89845a43e (diff)
parent0a67c3ebe158a796ede2c754bff313d5c5b5f170 (diff)
downloadCMake-7b4861b0823529233ec43ab394dffde9cce1188d.zip
CMake-7b4861b0823529233ec43ab394dffde9cce1188d.tar.gz
CMake-7b4861b0823529233ec43ab394dffde9cce1188d.tar.bz2
Merge topic 'xcode-12-new-build-system'
0a67c3ebe1 Xcode: Remove dependency Makefile hacks under the "new build system" c6c7f6fbeb Xcode: Remove remnants of ancient XCODE_DEPEND_HELPER utility target Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5267
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx35
-rw-r--r--Source/cmGlobalXCodeGenerator.h2
2 files changed, 21 insertions, 16 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index b2014e0..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())) {
@@ -1284,9 +1288,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 +3989,9 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
for (auto t : targets) {
this->AddDependAndLinkInformation(t);
}
- this->CreateXCodeDependHackTarget(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) {
@@ -4046,7 +4051,7 @@ void cmGlobalXCodeGenerator::ComputeObjectDirArch(cmMakefile* mf)
}
}
-void cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
+void cmGlobalXCodeGenerator::CreateXCodeDependHackMakefile(
std::vector<cmXCodeObject*>& 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<cmXCodeObject*>&);
bool IsHeaderFile(cmSourceFile*);
void AddDependTarget(cmXCodeObject* target, cmXCodeObject* dependTarget);
- void CreateXCodeDependHackTarget(std::vector<cmXCodeObject*>& targets);
+ void CreateXCodeDependHackMakefile(std::vector<cmXCodeObject*>& targets);
bool SpecialTargetEmitted(std::string const& tname);
void SetGenerationRoot(cmLocalGenerator* root);
void AddExtraTargets(cmLocalGenerator* root,