Skip to content

Commit

Permalink
Merge branch 'radekm-c3-lang-support'
Browse files Browse the repository at this point in the history
  • Loading branch information
floooh committed Feb 10, 2025
2 parents 132dd7c + 4395d06 commit 394ea32
Show file tree
Hide file tree
Showing 5 changed files with 498 additions and 1 deletion.
44 changes: 44 additions & 0 deletions .github/workflows/gen_bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ jobs:
with:
repository: colinbellino/sokol-jai
path: bindgen/sokol-jai
- uses: actions/checkout@main
with:
repository: floooh/sokol-c3
path: bindgen/sokol-c3
- name: generate
run: |
cd bindgen
Expand Down Expand Up @@ -108,6 +112,12 @@ jobs:
name: ignore-me-jai
retention-days: 1
path: bindgen/sokol-jai/sokol
- name: upload-c3-artifact
uses: actions/upload-artifact@main
with:
name: ignore-me-c3
retention-days: 1
path: bindgen/sokol-c3/sokol.c3l

test-zig:
needs: gen-bindings
Expand Down Expand Up @@ -323,6 +333,40 @@ jobs:
- name: build
run: echo "run jai here"

test-c3:
needs: gen-bindings
strategy:
# Continue build even if some platforms fail.
fail-fast: false
matrix:
include:
- os: macos-latest
arch: arm64
- os: ubuntu-latest
arch: x64
- os: windows-latest
arch: x64
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@main
with:
repository: floooh/sokol-c3
- uses: radekm/setup-c3@v2
with:
version: v0.6.6
- uses: actions/download-artifact@main
with:
name: ignore-me-c3
path: sokol.c3l
- name: prepare
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install libgl1-mesa-dev libegl1-mesa-dev mesa-common-dev xorg-dev libasound-dev
- name: build
shell: bash
run: ./build-examples.sh

# only deploy the bindings for commits on the main branch
deploy-zig:
needs: test-zig
Expand Down
1 change: 1 addition & 0 deletions bindgen/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ sokol-odin/
sokol-rust/
sokol-d/
sokol-jai/
sokol-c3/
1 change: 1 addition & 0 deletions bindgen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ To update the Zig bindings:
> git clone https://github.com/floooh/sokol-rust
> git clone https://github.com/floooh/sokol-d
> git clone https://github.com/colinbellino/sokol-jai
> git clone https://github.com/floooh/sokol-c3
> python3 gen_all.py
```

Expand Down
8 changes: 7 additions & 1 deletion bindgen/gen_all.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os, gen_nim, gen_zig, gen_odin, gen_rust, gen_d, gen_jai
import os, gen_nim, gen_zig, gen_odin, gen_rust, gen_d, gen_jai, gen_c3

tasks = [
[ '../sokol_log.h', 'slog_', [] ],
Expand Down Expand Up @@ -58,3 +58,9 @@
for task in tasks:
[c_header_path, main_prefix, dep_prefixes] = task
gen_rust.gen(c_header_path, main_prefix, dep_prefixes)

# C3
gen_c3.prepare()
for task in tasks:
[c_header_path, main_prefix, dep_prefixes] = task
gen_c3.gen(c_header_path, main_prefix, dep_prefixes)
Loading

0 comments on commit 394ea32

Please sign in to comment.