summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-09-14 18:50:14 (GMT)
committerBrad King <brad.king@kitware.com>2020-09-18 16:49:17 (GMT)
commit3ab18c870dc00499f33a40a193e95cc4e1df54ba (patch)
tree1a24ded617c390cec24bfa7451d45f003742ada7 /Source/cmGlobalXCodeGenerator.cxx
parent0d037179964c0786b6a8da181854de524ac2158d (diff)
downloadCMake-3ab18c870dc00499f33a40a193e95cc4e1df54ba.zip
CMake-3ab18c870dc00499f33a40a193e95cc4e1df54ba.tar.gz
CMake-3ab18c870dc00499f33a40a193e95cc4e1df54ba.tar.bz2
Xcode: Factor out build phase variable declarations
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx19
1 files changed, 12 insertions, 7 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index ae83573..be4f9ad 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1596,6 +1596,11 @@ void cmGlobalXCodeGenerator::CreateCustomCommands(
postbuild.push_back(std::move(command));
}
+ cmXCodeObject* legacyCustomCommandsBuildPhase = nullptr;
+ cmXCodeObject* preBuildPhase = nullptr;
+ cmXCodeObject* preLinkPhase = nullptr;
+ cmXCodeObject* postBuildPhase = nullptr;
+
std::vector<cmSourceFile*> classes;
if (!gtgt->GetConfigCommonSourceFiles(classes)) {
return;
@@ -1608,17 +1613,17 @@ void cmGlobalXCodeGenerator::CreateCustomCommands(
commands.push_back(*sourceFile->GetCustomCommand());
}
}
- // create prebuild phase
- cmXCodeObject* cmakeRulesBuildPhase = this->CreateLegacyRunScriptBuildPhase(
+ // create custom commands phase
+ legacyCustomCommandsBuildPhase = this->CreateLegacyRunScriptBuildPhase(
"CMake Rules", "cmakeRulesBuildPhase", gtgt, commands);
// create prebuild phase
- cmXCodeObject* preBuildPhase = this->CreateLegacyRunScriptBuildPhase(
+ preBuildPhase = this->CreateLegacyRunScriptBuildPhase(
"CMake PreBuild Rules", "preBuildCommands", gtgt, prebuild);
// create prelink phase
- cmXCodeObject* preLinkPhase = this->CreateLegacyRunScriptBuildPhase(
+ preLinkPhase = this->CreateLegacyRunScriptBuildPhase(
"CMake PreLink Rules", "preLinkCommands", gtgt, prelink);
// create postbuild phase
- cmXCodeObject* postBuildPhase = this->CreateLegacyRunScriptBuildPhase(
+ postBuildPhase = this->CreateLegacyRunScriptBuildPhase(
"CMake PostBuild Rules", "postBuildPhase", gtgt, postbuild);
// The order here is the order they will be built in.
@@ -1628,8 +1633,8 @@ void cmGlobalXCodeGenerator::CreateCustomCommands(
if (preBuildPhase) {
buildPhases->AddObject(preBuildPhase);
}
- if (cmakeRulesBuildPhase) {
- buildPhases->AddObject(cmakeRulesBuildPhase);
+ if (legacyCustomCommandsBuildPhase) {
+ buildPhases->AddObject(legacyCustomCommandsBuildPhase);
}
if (headerBuildPhase) {
buildPhases->AddObject(headerBuildPhase);