summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-06-18 17:39:23 (GMT)
committerBrad King <brad.king@kitware.com>2018-06-18 17:44:43 (GMT)
commitbc5bcad45e1eaebbea0f1409f096d166cdb778d9 (patch)
tree288910094177ffd862809b3d596dbaa7521aa64d /Source/cmGlobalXCodeGenerator.cxx
parentef5e2e8a62982ebccf4883fc7a01cdb66f8ca183 (diff)
downloadCMake-bc5bcad45e1eaebbea0f1409f096d166cdb778d9.zip
CMake-bc5bcad45e1eaebbea0f1409f096d166cdb778d9.tar.gz
CMake-bc5bcad45e1eaebbea0f1409f096d166cdb778d9.tar.bz2
Xcode: Detect architecture(s) using ARCHS instead of CURRENT_ARCH
Xcode 10 no longer populates `CURRENT_ARCH` with the current architecture in shell scripts and instead uses `undefined_arch`. Instead we must use `ARCHS`. It lists all architectures separated by spaces. Fixes: #18085
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 47741f9..58888c3 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -3156,8 +3156,13 @@ void cmGlobalXCodeGenerator::ComputeArchitectures(cmMakefile* mf)
if (this->Architectures.empty()) {
// With no ARCHS we use ONLY_ACTIVE_ARCH.
// Look up the arch that Xcode chooses in this case.
- if (const char* arch = mf->GetDefinition("CMAKE_XCODE_CURRENT_ARCH")) {
+ if (const char* arch = mf->GetDefinition("CMAKE_XCODE_ARCHS")) {
this->ObjectDirArchDefault = arch;
+ // We expect only one arch but choose the first just in case.
+ std::string::size_type pos = this->ObjectDirArchDefault.find(';');
+ if (pos != std::string::npos) {
+ this->ObjectDirArchDefault = this->ObjectDirArchDefault.substr(0, pos);
+ }
}
}