n64dev / cen64

Cycle-Accurate Nintendo 64 Emulator
BSD 3-Clause "New" or "Revised" License
803 stars 70 forks source link

Does not build for Arm #233

Open coderamen666 opened 2 years ago

coderamen666 commented 2 years ago

CMake does not seem to recognize aarch64 mac m1s during a build.

ChrisHelmsC commented 1 year ago

Think I may be seeing the same thing. Are you also getting an error that rsp.h cannot be found when running make?

command-tab commented 1 year ago

Same here on an M2 Pro:

[  2%] Building C object CMakeFiles/cen64.dir/ai/controller.c.o
/Users/callen/cen64/ai/controller.c:17:10: fatal error: 'rsp/rsp.h' file not found
#include "rsp/rsp.h"
         ^~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/cen64.dir/ai/controller.c.o] Error 1
make[1]: *** [CMakeFiles/cen64.dir/all] Error 2
make: *** [all] Error 2

rsp.h is on disk here:

$ find .. -name rsp.h
../arch/arm/rsp/rsp.h
../arch/x86_64/rsp/rsp.h

Notably, the CMake generated Makefile has lots of references to x86_64 and none for arm or aarch64. My cmake is ARM native, though:

$ which cmake
/opt/homebrew/bin/cmake
$ file /opt/homebrew/bin/cmake
/opt/homebrew/bin/cmake: Mach-O 64-bit executable arm64

So maybe there's a missing architecture flag or detection somewhere?