From b8e707a6a1c5c486644132df01b7995740abfbd2 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 15 May 2017 13:02:09 -0400 Subject: Xcode: Refactor internal decision for scheme generation Move the Xcode version check out to wrap everything. --- Source/cmGlobalXCodeGenerator.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index e2cb755..4e95fe7 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -3279,10 +3279,11 @@ void cmGlobalXCodeGenerator::OutputXCodeProject( // Since the lowest available Xcode version for testing was 7.0, // I'm setting this as a limit then - if (root->GetMakefile()->IsOn("CMAKE_XCODE_GENERATE_SCHEME") && - this->XcodeVersion >= 70) { - this->OutputXCodeSharedSchemes(xcodeDir); - this->OutputXCodeWorkspaceSettings(xcodeDir); + if (this->XcodeVersion >= 70) { + if (root->GetMakefile()->IsOn("CMAKE_XCODE_GENERATE_SCHEME")) { + this->OutputXCodeSharedSchemes(xcodeDir); + this->OutputXCodeWorkspaceSettings(xcodeDir); + } } this->ClearXCodeObjects(); -- cgit v0.12 From c608000a2a57faaac6e1789f8502e734db5ddb0e Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 15 May 2017 13:05:46 -0400 Subject: Xcode: Work around xcodebuild spurious hangs in try_compile `xcodebuild` occasionally hangs on some macOS machines (and can be reproduced independent of CMake). It only happens a few times in 1000 runs, but configuration of a large project calls `try_compile` many times and therefore frequently hangs due to this problem. I've been unable to reproduce the hang when using a scheme to build, so always generate a scheme in `try_compile` projects to work around the problem. Issue: #16752 --- Source/cmGlobalXCodeGenerator.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 4e95fe7..84740ca 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -3280,7 +3280,8 @@ void cmGlobalXCodeGenerator::OutputXCodeProject( // Since the lowest available Xcode version for testing was 7.0, // I'm setting this as a limit then if (this->XcodeVersion >= 70) { - if (root->GetMakefile()->IsOn("CMAKE_XCODE_GENERATE_SCHEME")) { + if (root->GetMakefile()->GetCMakeInstance()->GetIsInTryCompile() || + root->GetMakefile()->IsOn("CMAKE_XCODE_GENERATE_SCHEME")) { this->OutputXCodeSharedSchemes(xcodeDir); this->OutputXCodeWorkspaceSettings(xcodeDir); } -- cgit v0.12