Skip to content

Commit af8c57b

Browse files
authored
Merge pull request #105 from jackharrhy/feat/macos-aarch64
Support MacOS aarch64 / M series chips
2 parents 905059d + b9a28bc commit af8c57b

3 files changed

Lines changed: 20 additions & 2 deletions

File tree

Makefile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@ ifeq ($(COMPILE_ARCH),axp)
8080
COMPILE_ARCH=alpha
8181
endif
8282

83+
ifeq ($(COMPILE_ARCH),arm)
84+
COMPILE_ARCH=aarch64
85+
endif
86+
ifeq ($(COMPILE_ARCH),arm64)
87+
COMPILE_ARCH=aarch64
88+
endif
89+
8390
ifndef ARCH
8491
ARCH=$(COMPILE_ARCH)
8592
endif
@@ -458,7 +465,9 @@ else # ifeq Linux
458465
#############################################################################
459466

460467
ifeq ($(PLATFORM),darwin)
461-
HAVE_VM_COMPILED=true
468+
ifneq ($(findstring $(ARCH),x86 x86_64 ppc ppc64),)
469+
HAVE_VM_COMPILED=true
470+
endif
462471
LIBS = -framework Cocoa
463472
CLIENT_LIBS=
464473
RENDERER_LIBS=
@@ -482,6 +491,9 @@ ifeq ($(PLATFORM),darwin)
482491
ifeq ($(ARCH),x86_64)
483492
OPTIMIZEVM += -arch x86_64 -mfpmath=sse
484493
endif
494+
ifeq ($(ARCH),aarch64)
495+
OPTIMIZEVM += -arch arm64
496+
endif
485497

486498
# When compiling on OSX for OSX, we're not cross compiling as far as the
487499
# Makefile is concerned, as target architecture is specified as a compiler

code/qcommon/common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2773,7 +2773,7 @@ void Com_Init( char *commandLine ) {
27732773
Sys_Init();
27742774

27752775
if( Sys_WritePIDFile( ) ) {
2776-
#ifndef DEDICATED
2776+
#if !defined(DEDICATED) && !defined(MACOS_X)
27772777
const char *message = "The last time " CLIENT_WINDOW_TITLE " ran, "
27782778
"it didn't exit properly. This may be due to inappropriate video "
27792779
"settings. Would you like to start with \"safe\" video settings?";

code/qcommon/q_platform.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
161161
#define idx64 1
162162
#define ARCH_STRING "x86_64"
163163
#define Q3_LITTLE_ENDIAN
164+
#elif defined __aarch64__
165+
#define ARCH_STRING "aarch64"
166+
#define Q3_LITTLE_ENDIAN
167+
#elif defined __arm__
168+
#define ARCH_STRING "arm"
169+
#define Q3_LITTLE_ENDIAN
164170
#endif
165171

166172
#define DLL_EXT ".dylib"

0 commit comments

Comments
 (0)