A C++ build system written in Go using CUE for configuration. Clue provides minimal configuration for common cases, with CUE's type system catching config errors before build time.
Install from source:
go install github.com/loov/clue@latestOr build locally for development:
go build -o clue .Create a clue.cue file in your project directory:
name: "hello"
version: "1.0.0"
toolchain: {
compiler: "clang"
std: "c++17"
}
targets: {
hello: {
name: "hello"
type: "executable"
sources: ["main.cpp"]
}
}Validate and build:
clue validate # Check configuration
clue build # Build projectclue validate- Validate configuration and check dependenciesclue build- Build all targets (use-variant releasefor optimized builds)clue clean- Remove build artifacts (use-allto clean all variants)clue run <target>- Build and run an executable targetclue deps <list|fetch|clean|update>- Manage external dependenciesclue generate <ninja|compile-commands|all>- Generate build files for editors/tools
-variant debug|release- Select build variant (default: debug)-j N- Number of parallel jobs (0 = half CPU cores, -1 = all cores)-v- Verbose output showing detailed build steps-quiet- Suppress all non-error output-rebuild-all- Force rebuild of all files-keep-going- Continue building despite errors-target <platform>- Cross-compile for target platform (e.g., linux-arm64, darwin-amd64)
name: "calculator"
version: "1.0.0"
toolchain: {
compiler: "clang"
std: "c++17"
}
targets: {
mathlib: {
name: "mathlib"
type: "static_library"
sources: ["lib/math.cpp"]
headers: ["lib/math.h"]
}
app: {
name: "calculator"
type: "executable"
sources: ["src/main.cpp"]
includes: ["lib"]
depends: ["mathlib"]
}
}variants: {
debug: {
optimization: "none"
debugInfo: true
}
release: {
optimization: "aggressive"
debugInfo: false
}
}Build with a variant:
clue build -variant release