This repository contains tools and scripts to build a static version of Skia library in a form that can be referenced from a regular CMake or Makefile project.
For Linux it uses our cross-compilation Docker image based on Clang 20 with various sysroots
- point
skiasubmodule to the version of skia you need to build - add
depot_toolsto your shell's PATH - run `python3 tools/git-sync-deps
Run ./scripts/build.py headers
Run ./scripts/build-linux.sh <arch>, where arch is x64, arm64 or all
Run ./scripts/build.py <os> <arch> [--self-contained] [--debug], where:
<os>ismacos,darwin,mac,windows, orwin<arch>isx64,arm64, orall--debugproduces a debug build (defaults to release)
The scripts will produce a Skia build with static libraries in artifacts/<os>_<arch> with skia.h specific for that
skia configuration. Skia headers extracted from Skia are in artifacts/headers. You need to include both of those in
your include search path.
When linking your application, link with the static libraries from artifacts/<os>_<arch> (you might want to use --Wl,--start-group and --Wl,--end-group around those to resolve any circular dependencies).