The native target uses Odin, Clay's official Odin binding, and raylib. The web target uses the same Odin Clay application and an Odin render-command loop that draws through a tiny JavaScript Canvas 2D host.
Do not install Odin with Homebrew for this project; package-manager builds may
miss the vendor tree required for raylib.
This checkout was set up with the official Darwin arm64 release:
curl -L https://github.com/odin-lang/Odin/releases/download/dev-2026-07/odin-macos-arm64-dev-2026-07.tar.gz \
-o /private/tmp/odin-macos-arm64-dev-2026-07.tar.gz
mkdir -p ~/dev/releases/odin-dev-2026-07
tar -xzf /private/tmp/odin-macos-arm64-dev-2026-07.tar.gz \
-C ~/dev/releases/odin-dev-2026-07 --strip-components=1Verify the install:
~/dev/releases/odin-dev-2026-07/odin version
~/dev/releases/odin-dev-2026-07/odin root
ls "$(~/dev/releases/odin-dev-2026-07/odin root)/base" \
"$(~/dev/releases/odin-dev-2026-07/odin root)/core" \
"$(~/dev/releases/odin-dev-2026-07/odin root)/vendor"
ls "$(~/dev/releases/odin-dev-2026-07/odin root)/vendor/raylib"If macOS quarantines the compiler, clear it:
xattr -d com.apple.quarantine ~/dev/releases/odin-dev-2026-07/odinConfigure the compiler path for this checkout by copying the tracked example and
editing ODIN:
cp Makefile.local.example Makefile.localMakefile.local is git ignored so paths and other machine-specific overrides
stay local. You can also supply the compiler for a single invocation with
make native ODIN=/path/to/odin. Build-related targets fail with a setup hint
when ODIN is not configured; make clean does not require it.
For WebAssembly, wasm-ld must be installed. On this Mac it is available at
/opt/homebrew/bin/wasm-ld; the Makefile prepends /opt/homebrew/bin for the
web build.
make native
make webOutputs:
- Native app:
build/native/odin_clay_counter - Web app:
build/web/index.htmlplusbuild/web/app.wasm
Run the native app:
make runServe the web app on port 8080:
make serveThen open http://localhost:8080.
If another local service already owns 8080, use an alternate port:
make serve PORT=18080- Clay's official Odin binding is vendored in
vendor/clay-odin. - Departure Mono is bundled in
web/assetsunder the SIL Open Font License. The web build copies those assets tobuild/web/assets, and the native build copies them tobuild/native/assets. - Text uses a small Clay
fontIdregistry.APP_FONT_UIinsrc/app.odincurrently maps to Departure Mono in both renderers; add future fonts by extending the shared font ids, the native font array loader, and the webAPP_FONTStable. - Native layout uses logical raylib window size and renders Clay commands into a
render texture sized with
GetRenderWidth()/GetRenderHeight(). - Native startup uses a manual borderless-window setup matching raylib 5.5's
behavior instead of raylib 6.0's
ToggleBorderlessWindowed(), which produced mismatched render dimensions on macOS HighDPI. - Web layout uses CSS viewport pixels as logical coordinates, sizes the canvas
backing store with
devicePixelRatio, and renders scaled Clay commands into the backing store.