From fb189eec96d572049672e64f70fc2c55c8003480 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Mon, 18 Jan 2021 00:51:48 +0100 Subject: [PATCH] Enable building on Apple Silicon (based on the commit from Petter Uvesten in the main dhewm3 repo) --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index dda3795..923358d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -148,6 +148,9 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang") if(cpu STREQUAL "x86_64") add_compile_options(-arch x86_64 -mmacosx-version-min=10.6) set(ldflags "${ldflags} -arch x86_64 -mmacosx-version-min=10.6") + elseif(cpu STREQUAL "arm64") + add_compile_options(-arch arm64 -mmacosx-version-min=11.0) + set(ldflags "${ldflags} -arch arm64 -mmacosx-version-min=11.0") elseif(cpu STREQUAL "x86") CHECK_CXX_COMPILER_FLAG("-arch i386" cxx_has_arch_i386) if(cxx_has_arch_i386)