Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
basdp committed Oct 8, 2024
1 parent 6165238 commit a98624a
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
cd skia
python3 tools/git-sync-deps
python3 bin/fetch-ninja
bin/gn gen out/lib --platform=mingw --args='
bin/gn gen ../out/lib --platform=mingw --args='
is_debug=false
is_official_build=true
clang_win="C:/Program Files/LLVM"
Expand All @@ -41,7 +41,7 @@ jobs:
skia_use_expat=false
'
third_party/ninja/ninja -C out/lib skia
cp --recursive include out/include
cp --recursive include ../out/include
- name: Archive the build
uses: actions/upload-artifact@v4
with:
Expand Down
56 changes: 54 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,54 @@
# skia-zig
Skia Bindings for Zig
# Skia Zig Bindings

This repository provides Zig bindings to the Skia C API. It builds Skia for multiple platforms and exposes the raw C headers to be used directly in Zig projects. **No wrappers** are provided—this is a low-level binding to the C layer only.

## Features

- Builds Skia for multiple platforms (Linux, macOS, Windows, etc.)
- Exposes the raw Skia C API headers
- Compatible with Zig's `@cImport` for easy integration

## Getting Started

### Prerequisites

Before building, ensure you have the following dependencies installed:

- Zig (v0.10.0 or higher)
- CMake
- Ninja
- Python 3
- Clang (for compiling Skia)

### Building

To build Skia and set up the bindings for use in Zig, follow these steps:

1. Clone the repository:

```bash
git clone https://github.com/yourusername/skia-zig-bindings.git
cd skia-zig-bindings
```

2. Build Skia for your platform:

```bash
./build_skia.sh
```

This will download Skia, build it for your platform, and place the compiled libraries and headers in the `build/` directory.

3. Link the Skia libraries and include the C headers in your Zig project.

### Usage

After building, you can import the Skia C API headers in your Zig code as follows:

```zig
const skia = @cImport({
@cInclude("skia/c/sk_canvas.h");
@cInclude("skia/c/sk_paint.h");
@cInclude("skia/c/sk_surface.h");
// Add other Skia headers as needed
});

0 comments on commit a98624a

Please sign in to comment.