summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorGregor Jasny <gjasny@googlemail.com>2018-02-21 22:42:55 (GMT)
committerGregor Jasny <gjasny@googlemail.com>2018-02-22 20:15:48 (GMT)
commit481420ee89992cd8e761ce36808b3dc73ccc16d2 (patch)
treef4fc0d4b9a9a289b7894f4bda43e5730072bc124 /Source
parent13c5a91197dc99004e2c53864487aabdf09de936 (diff)
downloadCMake-481420ee89992cd8e761ce36808b3dc73ccc16d2.zip
CMake-481420ee89992cd8e761ce36808b3dc73ccc16d2.tar.gz
CMake-481420ee89992cd8e761ce36808b3dc73ccc16d2.tar.bz2
Xcode: Generate ZERO_CHECK generator target only once
In case CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY has been enabled generate only the root-level ZERO_CHECK target so targets in subdirectories pick up the root generator target of ZERO_CHECK. For the case that CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY is not enabled more investigation and a proper and final fix is still needed. Issue: 14297
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 2a38599..d3f5aac 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -459,7 +459,11 @@ void cmGlobalXCodeGenerator::AddExtraTargets(
// Add ZERO_CHECK
bool regenerate = !mf->IsOn("CMAKE_SUPPRESS_REGENERATION");
- if (regenerate) {
+ bool generateTopLevelProjectOnly =
+ mf->IsOn("CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY");
+ bool isTopLevel =
+ !root->GetStateSnapshot().GetBuildsystemDirectoryParent().IsValid();
+ if (regenerate && (isTopLevel || !generateTopLevelProjectOnly)) {
this->CreateReRunCMakeFile(root, gens);
std::string file =
this->ConvertToRelativeForMake(this->CurrentReRunCMakeMakefile.c_str());