diff options
author | Brad King <brad.king@kitware.com> | 2020-09-28 20:47:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-09-30 15:58:44 (GMT) |
commit | b6c60f14b6df53d8cb6fe442d801fdae50ddf287 (patch) | |
tree | c90ce25ec8c6e5fb66c514869474b465aa6bfa04 /Tests/Assembler | |
parent | 383e81aa60312433d25d68ab0ef4991aa3b869c1 (diff) | |
download | CMake-b6c60f14b6df53d8cb6fe442d801fdae50ddf287.zip CMake-b6c60f14b6df53d8cb6fe442d801fdae50ddf287.tar.gz CMake-b6c60f14b6df53d8cb6fe442d801fdae50ddf287.tar.bz2 |
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.txt | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Tests/Assembler/CMakeLists.txt b/Tests/Assembler/CMakeLists.txt index cee5210..a574c4e 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. |