Enable building on Apple Silicon

(based on the commit from Petter Uvesten in the main dhewm3 repo)
This commit is contained in:
Daniel Gibson 2021-01-18 00:51:48 +01:00
parent 2a649bd074
commit 372ae8bb73

View file

@ -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)