From 1100a3140749c7dc3547ec96f1e69f9cd92c8a89 Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Wed, 23 Dec 2020 00:26:53 -0700 Subject: [PATCH] CMake: Apple Silicon detection CMake's CMAKE_SYSTEM_PROCESSOR call returns "arm64" on Apple Silicon. This patch makes sure that arm64 and aarch64 are treated as the same architecture. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b01b90fc54..15c4126d64 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -206,7 +206,7 @@ elseif(_ARCH_64 AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|AMD64") add_definitions(-D_M_X86=1) add_definitions(-D_M_X86_64=1) check_and_add_flag(HAVE_SSE2 -msse2) -elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") +elseif(_ARCH_64 AND CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm64") set(_M_ARM_64 1) add_definitions(-D_M_ARM_64=1) # CRC instruction set is used in the CRC32 hash function