kakashidinho / metalangle

MetalANGLE: OpenGL ES to Metal API translation layer
Other
460 stars 64 forks source link

Build for mac M1? #85

Open wez opened 2 years ago

wez commented 2 years ago

Could you add an arm/m1 build for mac to the release downloads?

I was idly looking at building it for myself just now, but the instructions require python2 and I didn't feel like running through getting that installed!

Berstanio commented 2 years ago

Don't they have already a arm64 slice? At least lipo -info is reporting one

wez commented 2 years ago

Not for mac:

19:49 wez@mba ~/Downloads/MetalANGLE.dylib.mac
; lipo -info libGLESv2.dylib
Non-fat file: libGLESv2.dylib is architecture: x86_64
19:50 took 11s wez@mba ~/Downloads/MetalANGLE.dylib.mac
; file libGLESv2.dylib
libGLESv2.dylib: Mach-O 64-bit dynamically linked shared library x86_64
Berstanio commented 2 years ago

Ahh, you are right for the dylib download. Anything speaking against using the framework? This has both slices

kakashidinho commented 2 years ago

Yes, MetalANGLE.framework has both libEGL and libGLESv2 APIs in one package and it has both x86 and arm slices. You could use it if you feel like it. The dylibs are built using google's gn script and atm it doesn't support arm architecture yet (upstream repo might already has a update for this).

wez commented 2 years ago

My application uses cross-platform GL bindings that want to dynamically load libGL, so I can't use the framework version.

Berstanio commented 2 years ago

The framework in the releases are dynamic librarys too afaik. So couldn't you just dynamically load the the framework? Or extract the dynamic lib from the framework and load that?

wez commented 2 years ago

Ah, I see, I can copy the framework in and rename it to libEGL.dylib and load it that way