kakashidinho / metalangle

MetalANGLE: OpenGL ES to Metal API translation layer
Other
461 stars 65 forks source link

Mac Catalyst build #66

Closed mtehver closed 3 years ago

mtehver commented 3 years ago

I am having difficulty building the project with Mac Catalyst support. Any instructions or documentation how to do that would be very helpful. Thanks.

kakashidinho commented 3 years ago

Hi. What difficulties you are facing? Building mac catalyst version you just need to use the same target as iOS version, i.e. “MetalANGLE”, but must set target device to “my mac” instead of iOS device.

kakashidinho commented 3 years ago

If you want to build via xcodebuild, you need to pass “—sdk macosx” instead of “—sdk iphoneos”. Also need to set environment variable “SUPPORTS_MACCATALYST=YES” I believe.

mtehver commented 3 years ago

Thanks! Indeed, building from Xcode works. Though when I try building from command line using

xcodebuild -project OpenGLES.xcodeproj -target MetalANGLE_static -sdk macosx -configuration Release -destination 'platform=macOS,variant=Mac Catalyst'

I get error messages about UIKit not being available on macOS. Any idea what should I change or add to make it also work from command line?

kakashidinho commented 3 years ago

I think you have to set an environment variable. e.g SUPPORTS_MACCATALYST=YES xcodebuild ...

mtehver commented 3 years ago

I managed to compile the project from command line by replacing '-target' argument with '-scheme'. Thus the working command line is following:

xcodebuild -project OpenGLES.xcodeproj -scheme MetalANGLE_static -sdk macosx -configuration Release -destination 'platform=macOS,variant=Mac Catalyst' SUPPORTS_MACCATALYST=YES

Thanks for your help!