afritz1 / OpenTESArena

Open-source re-implementation of The Elder Scrolls: Arena.
MIT License
987 stars 68 forks source link

-march=native not supported on Apple M1 #248

Open Kurtjwest opened 1 year ago

Kurtjwest commented 1 year ago

When attempting to build from source on apple silicon, the error is returned:

the clang compiler does not support '-march=native'

This is fixed by changing -march=native to -mcpu=apple-m1 in the CMakeLists.txt file

Thunderforge commented 1 year ago

Is apple-m1 still the correct value if using an M2 processor?

afritz1 commented 1 year ago

I get that same error on my M1 Mac and I use that same change. It'd be good to detect in CMakeLists.txt if the system is Apple and ARM64.

Is apple-m1 still the correct value if using an M2 processor?

A quick search didn't reveal much, but -mcpu=apple-m1 should be okay until it becomes an issue. I think newer Clang versions allow -march=native.

afritz1 commented 2 months ago

I tried compiling again on my Mac and -march=native worked fine, not sure if this issue can be closed yet though.