summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-01-28 16:04:45 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-01-28 16:05:17 (GMT)
commit7706b6a71406b535ffe2f707647126eac4a8c767 (patch)
tree46e09b93fa4a482a9df9f60c71a55c98e5d728ad /Source/cmGlobalXCodeGenerator.cxx
parentee5edfbda22262a67f630bd83d5494c2ba0d7f44 (diff)
parent64304fe72b2956937b3e0916284aec1efa4dca78 (diff)
downloadCMake-7706b6a71406b535ffe2f707647126eac4a8c767.zip
CMake-7706b6a71406b535ffe2f707647126eac4a8c767.tar.gz
CMake-7706b6a71406b535ffe2f707647126eac4a8c767.tar.bz2
Merge topic 'xcode-top-level-only-with-object-library'
64304fe72b Xcode: Fix post build script for 'top level project only' opt Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4284
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index da56f3f..3d5c9c4 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -528,7 +528,8 @@ void cmGlobalXCodeGenerator::AddExtraTargets(
root->GetMakefile()->IsOn("CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY");
bool isTopLevel =
!root->GetStateSnapshot().GetBuildsystemDirectoryParent().IsValid();
- if (regenerate && (isTopLevel || !generateTopLevelProjectOnly)) {
+ bool isGenerateProject = isTopLevel || !generateTopLevelProjectOnly;
+ if (regenerate && isGenerateProject) {
this->CreateReRunCMakeFile(root, gens);
std::string file =
this->ConvertToRelativeForMake(this->CurrentReRunCMakeMakefile);
@@ -558,7 +559,8 @@ 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 (target->GetType() == cmStateEnums::OBJECT_LIBRARY) {
+ if (isGenerateProject &&
+ target->GetType() == cmStateEnums::OBJECT_LIBRARY) {
commandLines.front().back() = // fill placeholder
this->PostBuildMakeTarget(target->GetName(), "$(CONFIGURATION)");
gen->AddCustomCommandToTarget(