Update darwin CMakeLists.txt to support Apple Silicon on macOS (#480)

Without this change in a corresponding `CMakeLists.txt` it attempts to build `invokeNative` assembly for `X86_64` on Macs with Apple Silicon.

Co-authored-by: Wenyong Huang <wenyong.huang@intel.com>
This commit is contained in:
Max Desiatov 2020-12-27 04:16:46 +00:00 committed by GitHub
parent 50f9a3e340
commit 13f0b2485b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,7 +14,10 @@ set (CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
# Set WAMR_BUILD_TARGET, currently values supported:
# "X86_64", "AMD_64", "X86_32", "ARM[sub]", "THUMB[sub]", "MIPS", "XTENSA"
if (NOT DEFINED WAMR_BUILD_TARGET)
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
# Handle Apple Silicon
set (WAMR_BUILD_TARGET "AARCH64")
elseif (CMAKE_SIZEOF_VOID_P EQUAL 8)
# Build as X86_64 by default in 64-bit platform
set (WAMR_BUILD_TARGET "X86_64")
else ()