A fast, simple build tool for C projects. Inspired by cargo. Just add a smelt.toml
Warning
Work in progress. Not ready for production use.
- Simple TOML manifest
- Incremental builds with content hashing
- Parallel compilation
- Git, pkg-config and local dependency management
- Lockfile support for dependency pinning
- Debug/release profiles
compile_commands.jsongeneration for compatible LSP
git clone https://github.com/floofyplasma/smelt
cd smelt
gcc src/cmd/build.c src/cmd/ccflags.c src/cmd/clean.c src/cmd/init.c \
src/core/process_posix.c src/core/stringvec.c src/pkg/deps.c \
src/pkg/registry.c src/project/cache.c src/project/compdb.c src/project/lock.c \
src/project/manifest.c src/main.c vendor/tomlc17.c vendor/xxhash.c vendor/ya_getopt.c \
-Isrc -Ivendor -std=c17 -o smeltsmelt init # scaffold new project
smelt build # debug build (default)
smelt build release # release build
smelt run # build and run
smelt clean # remove build artifacts
smelt update # re-fetch dependencies
smelt add <url> <file1> [file2 ...] # add git dependency
smelt add --pkg-config <name> # add pkg-config dependency
smelt add <local/path> # add local smelt-aware dependencysmelt add https://github.com/Cyan4973/xxHash xxhash.h xxhash.c
smelt add https://github.com/cktan/tomlc17 src/tomlc17. src/tomlc17.hFiles are copied to vendor/, .c files auto-added to build, vendor/ auto-added to include paths.
If a local library has its own smelt.toml, smelt reads it automatically:
smelt add ../mylibSources are compiled incrementally alongside your project.
smelt add --pkg-config sdl2Include flags and linker flags are automatically applied.
-
smelt testcommand - Package registry with build recipes for some popular libs (SDL3, raylib, sqlite, etc.)
MIT, see LICENSE for details.