dcr.toml
Main project configuration file. Located at the project root.
Structure
[package]
# required fields
[build]
# build settings
[build.debug] # optional: debug override
[build.release] # optional: release override
[build.linux] # optional: Linux override
[build.windows] # optional: Windows override
[build.windows.debug] # target + profile combination
[toolchain]
# compiler/linker paths
[dependencies]
# project dependencies
[workspace]
# multi-package configuration
[run]
# run settings
[package]
| Field | Required | Description |
|---|---|---|
name | yes | Project name |
version | yes | Semantic version |
type | yes | app, lib, none |
license | no | SPDX license identifier |
author | no | Author |
[package]
name = "my-app"
version = "0.1.0"
type = "app"
license = "MIT"
author = "John Doe"
[build]
| Field | Default | Description |
|---|---|---|
language | "c" | "c", "c++", "cpp", "cxx", "asm" |
standard | "c11" | C standard (c11, c17, c23) |
cxx_standard | "c++20" | C++ standard (c++17, c++20, c++23) |
compiler | "clang" | Preferred compiler |
kind | "bin" | bin, staticlib, sharedlib, efi, elf, none, custom |
target | host | Target triple for cross-compilation |
platform | "native" | native, efi, freestanding |
cflags | [] | Additional C/C++/ASM flags |
ldflags | [] | Additional linker flags |
filename | "" | Custom output file name |
extension | "" | Custom file extension |
roots | ["src"] | Source root directories |
exclude | [] | Exclude patterns |
include | [] | Additional include directories |
src_disable | false | Disable auto source discovery |
inherit | false | Inherit build from workspace root |
clean | [] | Glob patterns for custom clean paths |
out_dir | "" | Custom output directory |
workspace_only | false | Workspace-only, not built standalone |
Settings from raw config (not in typed struct):
pkg_config— list of pkg-config packagesldscript— linker script pathbuild.steps/build.post_steps— codegen steps
Example:
[build]
language = "c++"
standard = "c23"
cxx_standard = "c++23"
compiler = "clang"
kind = "sharedlib"
cflags = ["-Wall", "-Wextra"]
[toolchain]
[toolchain]
cc = "/usr/bin/clang"
cxx = "/usr/bin/clang++"
as = "/usr/bin/as"
ar = "/usr/bin/ar"
ld = "/usr/bin/ld.lld"
Raw config also supports uic, moc, rcc for Qt codegen.
[dependencies]
See dependencies.
[run]
[run]
cmd = "./target/{profile}/{name}"
Substitutions:
{version}— package version{version_major},{version_minor},{version_patch},{version_suffix},{version_suffix_dash}— version parts{profile}— debug / release{name}— package name
Default cmd = ./target/{profile}/{name} (macOS/Windows) or ./target/<triple>/<profile>/<name> (Linux).
[workspace]
See workspaces.