summaryrefslogtreecommitdiff
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-09-28 16:47:36 -0400
committerBrad King <brad.king@kitware.com>2020-09-30 11:58:44 -0400
commitb6c60f14b6df53d8cb6fe442d801fdae50ddf287 (patch)
treec90ce25ec8c6e5fb66c514869474b465aa6bfa04 /Source/cmGlobalXCodeGenerator.cxx
parent383e81aa60312433d25d68ab0ef4991aa3b869c1 (diff)
downloadcmake-b6c60f14b6df53d8cb6fe442d801fdae50ddf287.tar.gz
macOS: Default to arm64 architecture on Apple Silicon hosts
Detect `arm64` hardware using a method that pierces Rosetta. If `CMAKE_OSX_ARCHITECTURES` is not set, pass explicit flags to the toolchain to use `arm64` instead of letting the toolchain pick. Fixes: #20989
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index b57bdbca6a..71b52ec0f7 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -4024,6 +4024,10 @@ void cmGlobalXCodeGenerator::ComputeArchitectures(cmMakefile* mf)
}
if (this->Architectures.empty()) {
+ mf->GetDefExpandList("_CMAKE_APPLE_ARCHS_DEFAULT", this->Architectures);
+ }
+
+ if (this->Architectures.empty()) {
// With no ARCHS we use ONLY_ACTIVE_ARCH and possibly a
// platform-specific default ARCHS placeholder value.
// Look up the arch that Xcode chooses in this case.