The missing everything tool for C and C++

A modern package manager, build system, and build cache in one static binary. Write packages in TOML, not an arcane language, and get reproducible, sandboxed builds that are as fast in CI as on your machine.

Install the latest alpha, then build an example to get started. Sign up for the mailing list for updates, join the Discord server, or send me an email.

curl -fsSL https://github.com/boonbane/spn/releases/latest/download/install.sh | sh
One binary replaces
  • make
  • cmake
  • conan
  • vcpkg
  • git submodules
  • pkg-config
  • ctest
  • dockerized builds
  • bash + python glue
  • ccache
  • vcvarsall
  • ninja

An extremely fast build system

spn turns familiar TOML package manifests into a build graph that it schedules and runs in parallel.

It never wraps another build system; it runs every compile and link in your build, including those of your dependencies.

Even better, it comes with a sophisticated, CI-friendly build cache out of the box. Switching branches, worktrees, or even cross compilation targets no longer means a rebuild!

spn.toml
[package]
name = "hello"
version = "0.1.0"

[[bin]]
name   = "hello"
source = ["main.c", "util/*.c"]

[deps.package]
sqlite = "3.51.0"

Zero dependency, single file binary

spn is a single file static executable. It runs on Linux, macOS, and Windows, and has zero dependencies.

It bundles the Zig toolchain, which means that it can cross compile from any host to nearly any other host, even when no compiler is installed.

It has first class support for nearly every common toolchain, including MSVC, GCC, Clang, Xcode, mingw64, wasi-sdk, ARM GCC, w64devkit, and more!

sh
# From any host
spn build --target x86_64-windows-gnu
spn build --target aarch64-macos
spn build --target aarch64-linux-musl

# On Windows, from any shell
spn build --toolchain msvc

Reproducible, sandboxed builds

Build scripts are plain C, not a DSL, and use the same packages your project already uses. spn compiles them to WebAssembly and runs them in a sandbox inside your build.

The sandbox sees every file a script reads, so build scripts are cached just like compiles. And when you just need to run a Python script so you can build your damn code, it helps with that, too!

build.c
SPN_EXPORT spn_err_t generate_config(spn_t* spn) {
  const char* path = "/source/config.json";
  yyjson_doc* doc = yyjson_read_file(path, 0, NULL, NULL);
  yyjson_val* root = yyjson_doc_get_root(doc);
  yyjson_val* foo = yyjson_obj_get(root, "foo");

  FILE* header = fopen("/work/config.h", "w");
  fprintf(header, "#define FOO %d\n", yyjson_get_int(foo));
  fclose(header);
  return SPN_OK;
}

A package manager built for C and C++

C does not have a package culture. Instead of forcing a central registry, spn provides simple primitives you can use to publish and consume code.

A package index is just a Git repository of manifests. Use the one we maintain, host your own, or skip the index and point a manifest at a commit.

Dependencies are built from source with the options you choose, pinned in a lockfile, and patched without forking.

spn.toml
[deps.package.imgui]
version = "1.92.8"
options = { sdl3 = true, sdlgpu3 = true }

[patch.imgui]
files = ["patches/frobnicate.patch"]

[deps.build]
yyjson = "0.14.0"

Try out the libraries you already use

See what it's like to package and use real libraries!

spn.toml
[package]
name = "window"
version = "0.1.0"

[[bin]]
name = "main"
source = ["main.c"]

[deps.package]
sdl3 = "3.4.14"

[config.sdl3]
options = { x11 = true }
SDL3 3.4.14 view on github
[package]
name = "sdl3"
version = "3.4.14"
system_deps = [
  { lib = "m", when = { os = "linux" } },
  { lib = "dl", when = { os = "linux" } },
  { lib = "pthread", when = { os = "linux" } },
  { lib = "user32", when = { os = "windows" } },
  { lib = "gdi32", when = { os = "windows" } },
  { lib = "winmm", when = { os = "windows" } },
  { lib = "imm32", when = { os = "windows" } },
  { lib = "ole32", when = { os = "windows" } },
  { lib = "oleaut32", when = { os = "windows" } },
  { lib = "version", when = { os = "windows" } },
  { lib = "uuid", when = { os = "windows" } },
  { lib = "advapi32", when = { os = "windows" } },
  { lib = "setupapi", when = { os = "windows" } },
  { lib = "shell32", when = { os = "windows" } },
  { lib = "dinput8", when = { os = "windows" } },
]

[package.upstream]
url = "https://github.com/libsdl-org/SDL.git"
commit = "147a8ee32dbf9ac02f3794964490687b6bbda1bc"

[deps.package]
xorgproto = { version = "2025.1.0", when = { os = "linux", x11 = true } }
libx11 = { version = "1.8.13", when = { os = "linux", x11 = true } }
libxext = { version = "1.3.7", when = { os = "linux", x11 = true } }
libxcursor = { version = "1.2.3", when = { os = "linux", x11 = true } }
libxfixes = { version = "6.0.2", when = { os = "linux", x11 = true } }
libxi = { version = "1.8.3", when = { os = "linux", x11 = true } }
libxrandr = { version = "1.5.5", when = { os = "linux", x11 = true } }
libxrender = { version = "0.9.12", when = { os = "linux", x11 = true } }
libxscrnsaver = { version = "1.2.5", when = { os = "linux", x11 = true } }
libxtst = { version = "1.2.5", when = { os = "linux", x11 = true } }
libglvnd = { version = "1.7.0", when = { os = "linux", x11 = true } }
libxcb = { version = "1.17.0", when = { os = "linux", x11 = true } }
alsa-lib = { version = "1.2.15", when = { os = "linux", alsa = true } }
pulseaudio = { version = "17.0.0", when = { os = "linux", pulseaudio = true } }
pipewire = { version = "1.6.8", when = { os = "linux", pipewire = true } }
dbus = { version = "1.16.99", when = { os = "linux", dbus = true } }
systemd = { version = "261.3.0", when = { os = "linux", udev = true } }

[options.x11]
type = "bool"
default = false
public = true
define = "SPN_SDL3_X11"

[options.alsa]
type = "bool"
default = false
public = true
define = "SPN_SDL3_ALSA"

[options.pulseaudio]
type = "bool"
default = false
public = true
define = "SPN_SDL3_PULSEAUDIO"

[options.pipewire]
type = "bool"
default = false
public = true
define = "SPN_SDL3_PIPEWIRE"

[options.oss]
type = "bool"
default = false
public = true
define = "SPN_SDL3_OSS"

[options.dbus]
type = "bool"
default = false
public = true
define = "SPN_SDL3_DBUS"

[options.udev]
type = "bool"
default = false
public = true
define = "SPN_SDL3_UDEV"

[[lib]]
name = "SDL3"
kinds = ["static"]
include = [
  { path = "config", tree = "manifest" },
  "include/build_config",
  "include",
  "src",
  "src/video/khronos",
]
source = [
  "src/*.c",
  "src/atomic/*.c",
  "src/audio/*.c",
  "src/audio/disk/*.c",
  "src/audio/dummy/*.c",
  "src/camera/*.c",
  "src/camera/dummy/*.c",
  "src/core/*.c",
  "src/cpuinfo/*.c",
  "src/dialog/*.c",
  "src/dynapi/*.c",
  "src/events/*.c",
  "src/filesystem/*.c",
  "src/gpu/*.c",
  "src/haptic/*.c",
  "src/haptic/hidapi/*.c",
  "src/hidapi/*.c",
  "src/io/*.c",
  "src/io/generic/*.c",
  "src/joystick/*.c",
  "src/joystick/hidapi/*.c",
  "src/joystick/virtual/*.c",
  "src/libm/*.c",
  "src/locale/*.c",
  "src/main/*.c",
  "src/main/generic/*.c",
  "src/misc/*.c",
  "src/power/*.c",
  "src/process/*.c",
  "src/render/*.c",
  "src/render/gpu/*.c",
  "src/render/opengl/*.c",
  "src/render/opengles2/*.c",
  "src/render/software/*.c",
  "src/render/vulkan/*.c",
  "src/sensor/*.c",
  "src/sensor/dummy/*.c",
  "src/stdlib/*.c",
  "src/storage/*.c",
  "src/storage/generic/*.c",
  "src/storage/steam/*.c",
  "src/thread/*.c",
  "src/time/*.c",
  "src/timer/*.c",
  "src/tray/*.c",
  "src/video/*.c",
  "src/video/dummy/*.c",
  "src/video/offscreen/*.c",
  "src/video/yuv2rgb/*.c",

  "src/gpu/vulkan/*.c",

  { path = "src/camera/v4l2/*.c", when = { os = "linux" } },
  { path = "src/core/unix/*.c", when = { os = "linux" } },
  { path = "src/core/linux/SDL_evdev.c", when = { os = "linux" } },
  { path = "src/core/linux/SDL_evdev_capabilities.c", when = { os = "linux" } },
  { path = "src/core/linux/SDL_evdev_kbd.c", when = { os = "linux" } },
  { path = "src/core/linux/SDL_threadprio.c", when = { os = "linux" } },
  { path = "src/dialog/unix/*.c", when = { os = "linux" } },
  { path = "src/filesystem/posix/*.c", when = { os = "linux" } },
  { path = "src/filesystem/unix/*.c", when = { os = "linux" } },
  { path = "src/haptic/linux/*.c", when = { os = "linux" } },
  { path = "src/io/io_uring/*.c", when = { os = "linux" } },
  { path = "src/joystick/linux/*.c", when = { os = "linux" } },
  { path = "src/loadso/dlopen/*.c", when = { os = "linux" } },
  { path = "src/locale/unix/*.c", when = { os = "linux" } },
  { path = "src/misc/unix/*.c", when = { os = "linux" } },
  { path = "src/power/linux/*.c", when = { os = "linux" } },
  { path = "src/process/posix/*.c", when = { os = "linux" } },
  { path = "src/thread/pthread/*.c", when = { os = "linux" } },
  { path = "src/time/unix/*.c", when = { os = "linux" } },
  { path = "src/timer/unix/*.c", when = { os = "linux" } },
  { path = "src/tray/unix/*.c", when = { os = "linux" } },

  { path = "src/video/x11/*.c", when = { os = "linux", x11 = true } },
  { path = "src/audio/alsa/*.c", when = { os = "linux", alsa = true } },
  { path = "src/audio/pulseaudio/*.c", when = { os = "linux", pulseaudio = true } },
  { path = "src/audio/pipewire/*.c", when = { os = "linux", pipewire = true } },
  { path = "src/audio/dsp/*.c", when = { os = "linux", oss = true } },
  { path = "src/core/linux/SDL_dbus.c", when = { os = "linux", dbus = true } },
  { path = "src/core/linux/SDL_fcitx.c", when = { os = "linux", dbus = true } },
  { path = "src/core/linux/SDL_ime.c", when = { os = "linux", dbus = true } },
  { path = "src/core/linux/SDL_progressbar.c", when = { os = "linux", dbus = true } },
  { path = "src/core/linux/SDL_system_theme.c", when = { os = "linux", dbus = true } },
  { path = "src/core/linux/SDL_udev.c", when = { os = "linux", udev = true } },

  { path = "src/audio/directsound/*.c", when = { os = "windows" } },
  { path = "src/audio/wasapi/*.c", when = { os = "windows" } },
  { path = "src/camera/mediafoundation/*.c", when = { os = "windows" } },
  { path = "src/core/windows/*.c", when = { os = "windows" } },
  { path = "src/dialog/windows/*.c", when = { os = "windows" } },
  { path = "src/filesystem/windows/*.c", when = { os = "windows" } },
  { path = "src/gpu/d3d12/*.c", when = { os = "windows" } },
  { path = "src/haptic/windows/*.c", when = { os = "windows" } },
  { path = "src/io/windows/*.c", when = { os = "windows" } },
  { path = "src/joystick/windows/*.c", when = { os = "windows" } },
  { path = "src/loadso/windows/*.c", when = { os = "windows" } },
  { path = "src/locale/windows/*.c", when = { os = "windows" } },
  { path = "src/main/windows/*.c", when = { os = "windows" } },
  { path = "src/misc/windows/*.c", when = { os = "windows" } },
  { path = "src/power/windows/*.c", when = { os = "windows" } },
  { path = "src/process/windows/*.c", when = { os = "windows" } },
  { path = "src/render/direct3d/*.c", when = { os = "windows" } },
  { path = "src/render/direct3d11/*.c", when = { os = "windows" } },
  { path = "src/render/direct3d12/*.c", when = { os = "windows" } },
  { path = "src/sensor/windows/*.c", when = { os = "windows" } },
  { path = "src/thread/windows/*.c", when = { os = "windows" } },
  { path = "src/thread/generic/SDL_syscond.c", when = { os = "windows" } },
  { path = "src/thread/generic/SDL_sysrwlock.c", when = { os = "windows" } },
  { path = "src/time/windows/*.c", when = { os = "windows" } },
  { path = "src/timer/windows/*.c", when = { os = "windows" } },
  { path = "src/tray/windows/*.c", when = { os = "windows" } },
  { path = "src/video/windows/*.c", when = { os = "windows" } },
  { path = "src/core/windows/*.cpp", when = { os = "windows" } },
  { path = "src/video/windows/*.cpp", when = { os = "windows" } },
  { path = "src/joystick/gdk/*.cpp", when = { os = "windows" } },

  { path = "src/audio/coreaudio/*.m", when = { os = "macos" } },
  { path = "src/camera/coremedia/*.m", when = { os = "macos" } },
  { path = "src/core/unix/*.c", when = { os = "macos" } },
  { path = "src/dialog/cocoa/*.m", when = { os = "macos" } },
  { path = "src/filesystem/cocoa/*.m", when = { os = "macos" } },
  { path = "src/filesystem/posix/*.c", when = { os = "macos" } },
  { path = "src/gpu/metal/*.m", when = { os = "macos" } },
  { path = "src/haptic/darwin/*.c", when = { os = "macos" } },
  { path = "src/joystick/apple/*.m", when = { os = "macos" } },
  { path = "src/joystick/darwin/*.c", when = { os = "macos" } },
  { path = "src/loadso/dlopen/*.c", when = { os = "macos" } },
  { path = "src/locale/macos/*.m", when = { os = "macos" } },
  { path = "src/misc/macos/*.m", when = { os = "macos" } },
  { path = "src/power/macos/*.c", when = { os = "macos" } },
  { path = "src/process/posix/*.c", when = { os = "macos" } },
  { path = "src/render/metal/*.m", when = { os = "macos" } },
  { path = "src/thread/pthread/*.c", when = { os = "macos" } },
  { path = "src/time/unix/*.c", when = { os = "macos" } },
  { path = "src/timer/unix/*.c", when = { os = "macos" } },
  { path = "src/tray/cocoa/*.m", when = { os = "macos" } },
  { path = "src/video/cocoa/*.m", when = { os = "macos" } },
]
define = [
  { value = "_REENTRANT", when = { os = "linux" } },
  { value = "_THREAD_SAFE", when = { os = "macos" } },
]
flags = [
  { value = "-fno-strict-aliasing", when = { driver = { not = "msvc" } } },
  { value = "-fvisibility=hidden", when = { driver = { not = "msvc" } } },
  { value = "-msse", when = { arch = "x86_64", driver = { not = "msvc" } } },
  { value = "-msse2", when = { arch = "x86_64", driver = { not = "msvc" } } },
  { value = "-msse3", when = { arch = "x86_64", driver = { not = "msvc" } } },
  { value = "-fobjc-arc", when = { os = "macos" } },
]
system_deps = [
  { framework = "AVFoundation" },
  { framework = "AudioToolbox" },
  { framework = "Carbon" },
  { framework = "Cocoa" },
  { framework = "CoreAudio" },
  { framework = "CoreFoundation" },
  { framework = "CoreHaptics" },
  { framework = "CoreMedia" },
  { framework = "CoreVideo" },
  { framework = "ForceFeedback" },
  { framework = "GameController" },
  { framework = "IOKit" },
  { framework = "Metal" },
  { framework = "QuartzCore" },
  { framework = "UniformTypeIdentifiers" },
]

[package.publish]
include = [
  { from = "include/SDL3/*.h", to = "SDL3" },
]

[[example]]
name = "window"
source = [{ path = "example/window.c", tree = "manifest" }]
deps = ["SDL3"]

[[example]]
name = "gpu"
source = [{ path = "example/gpu.c", tree = "manifest" }]
deps = ["SDL3"]

[profile.default]
options = { x11 = true }

Install

curl -fsSL https://github.com/boonbane/spn/releases/latest/download/install.sh | sh

Sign up for the mailing list

Join the Discord

spn on Discord questions, bug reports, and chat join →