Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ jobs:
with:
node-version: 22

- name: install binaryen
run: sudo apt-get install -y binaryen

- name: Build WASM
run: make

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
with:
deno-version: v2.x

- name: install binaryen
run: sudo apt-get install -y binaryen

- name: build wasm
run: make

Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
with:
deno-version: v2.x

- name: install binaryen
run: sudo apt-get install -y binaryen

- name: build wasm
run: make

Expand Down Expand Up @@ -52,6 +55,9 @@ jobs:
with:
deno-version: v2.x

- name: install binaryen
run: sudo apt-get install -y binaryen

- name: build wasm
run: make

Expand Down Expand Up @@ -125,6 +131,9 @@ jobs:
with:
deno-version: v2.x

- name: install binaryen
run: sudo apt-get install -y binaryen

- name: build wasm
run: make

Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ jobs:
- name: lint
run: deno lint

- name: install binaryen
run: sudo apt-get install -y binaryen

- name: build wasm
run: make

Expand Down Expand Up @@ -97,6 +100,9 @@ jobs:
with:
deno-version: v2.x

- name: install binaryen
run: sudo apt-get install -y binaryen

- name: build wasm
run: make

Expand Down Expand Up @@ -126,6 +132,9 @@ jobs:
with:
node-version: 24

- name: install binaryen
run: sudo apt-get install -y binaryen

- name: build wasm
run: make

Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
CC = clang
WASM_OPT ?= wasm-opt
TARGET = clayterm.wasm
SRC = src/module.c

CFLAGS = --target=wasm32 -nostdlib -O2 \
CFLAGS = --target=wasm32 -nostdlib -Oz \
-ffunction-sections -fdata-sections \
-mbulk-memory \
-DCLAY_IMPLEMENTATION -DCLAY_WASM \
Expand Down Expand Up @@ -48,6 +49,7 @@ DEPS = $(wildcard src/*.c src/*.h)

$(TARGET): $(DEPS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(SRC)
$(WASM_OPT) -Oz --enable-bulk-memory -o $@ $@

wasm.ts: $(TARGET)
deno run --allow-read --allow-write tasks/bundle-wasm.ts
Expand Down
Loading