Skip to main content

Introduction

Confy is a buildsystem for compiling C/C++/Nim code.
You can expect:

  • Ergonomic, readable and minimal/simple syntax.
  • Behaves as a library.
    You own the binary that runs the compilation commands.
  • Easy cross-compilation.
    No compiler/buildsystem gymnastics. Cross-compilation is builtin.

Example build file

import confy

let code = srcDir.glob() # Get our source by grabbing all code from the `srcDir` folder
var bin = Program.new( # Build an executable program
src = code, # Define our source code
trg = "hello.exe", # Define our binary
)

bin.build() # Order to build
important

If this is your first time using Confy:
Follow the Quickstart guide to get up and running in just 5min ⏱️

Other notable features

  • Sane project configuration defaults.
    Fully configurable, but no need to repeat yourself.

  • Imperative, not declarative.
    You own the control flow of your buildsystem.

  • Inspired by SCons.
    But without Python, a typeless language that quickly falls apart as code size grows.

  • Builds with ZigCC.
    Builtin sanitizing, caching, cross-compilation, musl/glibc/others, etc, etc ...

  • No extra compilers or confusing setup.
    Confy auto-downloads the latest zigcc version for the host.

There is a full how-to walkthrough in the Confy: Getting Started guide.
See the @examples folder for references on to use and setup the buildsystem.

note

Note: ZigCC is the binary compiler used, but this doesn't mean we build Zig code.
This project is used to build C, C++ and Nim projects.

Configuration

All the configuration variables are stored @confy/cfg.nim.
Add cfg.theVariable = value at the top of your build.nim file to change any of them:

import confy
cfg.srcDir = "./code" # Changes the source code folder from its default `rootDir/"src"`.
cfg.binDir = "./build" # Changes the binaries output folder from its default `rootDir/"bin"`.
cfg.verbose = on # Makes the cli output information completely verbose. (for debugging)
cfg.quiet = on # Makes the cli output information to be as minimal as possible. (for cleaner cli output) (default: on)
# Note: verbose = on will ignore quiet being active. (default: off)

See the Configuration API page, or the @confy/cfg.nim file for the complete list of variables that can be modified.