https://github.com/olilarkin/skia-builder
Build Skia libs for multiple platforms
https://github.com/olilarkin/skia-builder
skia wasm xcframework
Last synced: 5 months ago
JSON representation
Build Skia libs for multiple platforms
- Host: GitHub
- URL: https://github.com/olilarkin/skia-builder
- Owner: olilarkin
- License: mit
- Created: 2024-08-31T20:21:41.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-21T07:37:08.000Z (about 1 year ago)
- Last Synced: 2025-04-30T06:42:22.221Z (about 1 year ago)
- Topics: skia, wasm, xcframework
- Language: Python
- Homepage:
- Size: 33.2 KB
- Stars: 11
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# SKIA BUILDER
This is a python script and github actions workflow to manage building static libraries for [SKIA](https://skia.org/).

The script automates the process of building the libraries for various platforms (macOS, iOS, Windows, WASM). It handles the setup of the build environment, cloning of the Skia repository, configuration of build parameters, and compilation. The script also includes functionality for creating universal binaries for macOS and an XCFramework for apple platforms.
The GN Args are supplied in constants which you will need to tweak if you want to modify the build.
## Building
Skia's build scripts requires ninja and python3 to be installed on all platforms. Emscripten is installed via skia.
## Helper commands
There is a Makefile with helper commands to build the libraries for each platform (from macOS). On windows you can use the `build-win.sh` script.
```bash
make example-mac # Build example for macOS (will also build libSkia etc)
./example/build-mac/example
Image saved as output.png
```
Other options:
```bash
make skia-mac # Build libraries for macOS
make skia-ios # Build libraries for iOS
make skia-wasm # Build libraries for WASM
make skia-xcframework # Build XCFramework
make example-mac # Build example for macOS
make example-wasm # Build example for WASM
make serve-wasm # Serve the WASM example
```
## Build script
The script is called as follows
```
build-skia.py [-h] [-config {Debug,Release}] [-archs ARCHS] [-branch BRANCH] [--shallow] {mac,ios,win,spm,wasm}
```
## Building on macOS
Note: you may need to call
```bash
ulimit -n 2048
```
in order to increase the number of files that can be opened at once.
### Build for macOS universal (arm64 & x86_64 intel)
```bash
python3 build-skia.py -config Release -branch chrome/m129 mac
```
### Build for iOS (including x86_64 simulator)
```bash
python3 build-skia.py -config Release -branch chrome/m129 ios
```
### Build an XCFramework
```bash
python3 build-skia.py -config Release -branch chrome/m129 xcframework
```
## Building on Windows
On Windows, you need to install LLVM in order to compile Skia with clang, as recommened by the authors.
LLVM should be installed in `C:\Program Files\LLVM\`
```bash
py -3 build-skia.py -config Release -branch chrome/m129 win
```