summaryrefslogtreecommitdiff
path: root/Tests/Assembler
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 /Tests/Assembler
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 'Tests/Assembler')
-rw-r--r--Tests/Assembler/CMakeLists.txt2
1 files changed, 2 insertions, 0 deletions
diff --git a/Tests/Assembler/CMakeLists.txt b/Tests/Assembler/CMakeLists.txt
index cee5210de8..a574c4e1fc 100644
--- a/Tests/Assembler/CMakeLists.txt
+++ b/Tests/Assembler/CMakeLists.txt
@@ -18,6 +18,8 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile|Xcode|Ninja" AND
endif()
if(CMAKE_OSX_ARCHITECTURES)
list(APPEND C_FLAGS -arch ${CMAKE_OSX_ARCHITECTURES})
+ elseif("${CMAKE_SYSTEM_NAME};${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "Darwin;arm64")
+ list(APPEND C_FLAGS -arch arm64)
endif()
# Clang on OS X, and perhaps other compilers, do not support -g
# for both generating and assembling, so drop it from generating.