Skip to content

Prebuilt ANGLE binaries for iOS (using Metal backend)

License

Notifications You must be signed in to change notification settings

nutiteq/angle-metal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prebuilt ANGLE binary for iOS using Metal (arm64, armv7, x86_64)

Based on ANGLE master branch, current version is 8ef9aba7a42f015a35e1e318affe188c3806f539.

Compiling instructions

In file src/libANGLE/renderer/gl/eagl/DisplayEAGL.mm change kEAGLRenderingAPIOpenGLES3 to kEAGLRenderingAPIOpenGLES2. This updates target OpenGLES version to 2, which is required for old 32-bit iOS devices (iPhone 5).

Set these parameters for 'MetalANGLE_static' target and 'OpenGLES' project:

Build Active Architecture Only: Yes
Deployment Postprocessing: Yes
Strip Linked Product: Yes
Strip Style: Non-Global Symbols
Perform Single-Object Prelink: Yes
Preserve Private External Symbols: No
Symbols Hidden By Default: No
Inline Methods Hidden: Yes
Preprocessor Macros: ANGLE_PLATFORM_EXPORT=, ANGLE_EXPORT=, ANGLE_UTIL_EXPORT=

Important: enable C++ exceptions via following options (otherwise exceptions may not work in dependent projects):

Enable C++ Exceptions: Yes
Enable C++ Runtime Types: Yes
Enable Objective C Exceptions: Yes

After changing the targets the static libraries can be built for all targets:

cd ios/xcode

./fetchDependencies.sh

xcodebuild -showsdks

rm -rf build
xcodebuild -project OpenGLES.xcodeproj -target MetalANGLE_static -configuration Release -arch arm64 -sdk iphoneos13.2 build
echo Output is in build/Release-iphoneos/libMetalANGLE_static.a

rm -rf build
xcodebuild -project OpenGLES.xcodeproj -target MetalANGLE_static -configuration Release -arch armv7 -sdk iphoneos13.2 build
echo Output is in build/Release-iphoneos/libMetalANGLE_static.a

rm -rf build
xcodebuild -project OpenGLES.xcodeproj -target MetalANGLE_static -configuration Release -arch x86_64 -sdk iphonesimulator13.2 build
echo Output is in build/Release-iphonesimulator/libMetalANGLE_static.a

rm -rf build
xcodebuild -project OpenGLES.xcodeproj -target MetalANGLE_static -configuration Release -arch i386 -sdk iphonesimulator13.2 build
echo Output is in build/Release-iphonesimulator/libMetalANGLE_static.a

rm -rf build
xcodebuild -project OpenGLES.xcodeproj -target MetalANGLE_static -configuration Release -arch arm64 -sdk iphonesimulator13.2 build
echo Output is in build/Release-iphonesimulator/libMetalANGLE_static.a

Note: to enable Bitcode, add OTHER_CFLAGS="-fembed-bitcode" to command line arguments for arm64 and armv7 iOS targets.

In order to build libraries for Mac Catalyst, use the following commands:

xcodebuild -project OpenGLES.xcodeproj -scheme MetalANGLE_static -sdk macosx -configuration Release -destination 'platform=macOS,variant=Mac Catalyst' build SUPPORTS_MACCATALYST=YES
lipo <PATH_TO_OUTPUT>/libMetalANGLE_static.a -extract x86_64 -output libMetalANGLE_static_x86_64.a
lipo <PATH_TO_OUTPUT>/libMetalANGLE_static.a -extract arm64 -output libMetalANGLE_static_arm64.a

About

Prebuilt ANGLE binaries for iOS (using Metal backend)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published