From 19531654227522416cd37d48e7407d1ae055ec4b Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Thu, 7 Apr 2022 08:35:45 +0200 Subject: [PATCH] set ARM64 if detected under OSX --- CMakeLists.txt | 4 +++- cmake/target_arch_detect.cpp | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a9e121d02..5fef02be9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -198,7 +198,9 @@ elseif (CMAKE_SYSTEM_NAME MATCHES "GNU") message(STATUS "Platform: GNU/Hurd") list(APPEND Z3_COMPONENT_CXX_DEFINES "-D_HURD_") elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin") - # Does macOS really not need any special flags? + if (TARGET_ARCHITECTURE STREQUAL "arm64") + set(CMAKE_OSX_ARCHITECTURES "arm64") + endif() message(STATUS "Platform: Darwin") elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") message(STATUS "Platform: FreeBSD") diff --git a/cmake/target_arch_detect.cpp b/cmake/target_arch_detect.cpp index 0a2d0f3e6..379b5817e 100644 --- a/cmake/target_arch_detect.cpp +++ b/cmake/target_arch_detect.cpp @@ -5,6 +5,8 @@ #error CMAKE_TARGET_ARCH_i686 #elif defined(__x86_64__) || defined(_M_X64) #error CMAKE_TARGET_ARCH_x86_64 +#elif defined(__ARM_ARCH_ISA_A64) +#error CMAKE_TARGET_ARCH_arm64 #elif defined(__ARM_ARCH) #error CMAKE_TARGET_ARCH_arm #else