Trihedraf/odin-setup

★ 0Forks 0PowerShellGitHub ↗Compare

README

odin-setup

Portable, self-contained Odin + raylib setup. Everything lives inside the odin/ directory — nothing is installed system-wide and no environment variables or PATH entries are modified. Drop the odin/ folder into any project.

Requirements

  • Linux: curl, tar, clang (Odin links with clang)
  • macOS: Command Line Tools (xcode-select --install), curl, tar
  • Windows: VS Build Tools with the "Desktop development with C++" workload (MSVC linker); downloads use the built-in BITS (Start-BitsTransfer). If the Build Tools are missing, run .\odin\scripts\setup-windows-msvc.ps1 to install them.

Setup

./odin/scripts/setup-linux.sh       # Linux
./odin/scripts/setup-macos.sh       # macOS
powershell -ExecutionPolicy Bypass -File .\odin\scripts\setup-windows.ps1   # Windows

Each script downloads the latest Odin and raylib release for your platform/architecture, installs them into odin/bin/, and runs a smoke-test build of the raylib test app. Re-running a script reuses the cached archives in odin/downloads/.

To pin specific versions:

ODIN_TAG=dev-2026-09 RAYLIB_TAG=6.0 ./odin/scripts/setup-linux.sh

GITHUB_TOKEN is used for GitHub API requests if set.

Windows: MSVC Build Tools (optional helper)

Odin needs the MSVC linker to build executables on Windows. The optional helper script installs the Visual Studio Build Tools with the C++ workload silently — it skips if already installed, self-elevates via UAC, and needs several GB of disk space:

.\odin\scripts\setup-windows-msvc.ps1

Then rerun .\odin\scripts\setup-windows.ps1.

Layout

odin/
  bin/
    odin/        Odin compiler with core/vendor collections
    raylib/      raylib headers and prebuilt libraries
  downloads/     cached release archives
  test/          build output
  scripts/       setup and build scripts
    smoke_test/  raylib test app used to verify the setup

Building

./odin/scripts/build.sh                        # builds odin/scripts/smoke_test -> odin/test/smoke_test
./odin/scripts/build.sh <package-dir> [args]   # builds any Odin package, extra args forwarded to odin
.\odin\scripts\build.ps1                       # Windows
.\odin\scripts\build.ps1 <package-dir> [args]

Or call the compiler directly — it is fully portable and finds its collections relative to its own location:

./odin/bin/odin/odin version
./odin/bin/odin/odin run ./odin/scripts/smoke_test

raylib notes

  • Use raylib via import rl "vendor:raylib" (rlgl is available separately as vendor:raylib/rlgl; raygui and raymath are included in the main package).
  • Odin's vendor collection already bundles raylib libraries matching its binding, so no linker flags are needed.
  • Linking is static by default, so built executables are self-contained (on Windows no raylib.dll needs to be shipped).
  • For shared linking use -define:RAYLIB_SHARED=true and place the matching library (raylib.dll / libraylib.so.600 / libraylib.600.dylib, available in odin/bin/raylib/lib and odin/bin/odin/vendor/raylib/<platform>) next to the executable.

Contributors

Trihedraf

Issues