Skip to main content

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]

FieldRequiredDescription
nameyesProject name
versionyesSemantic version
typeyesapp, lib, none
licensenoSPDX license identifier
authornoAuthor
[package]
name = "my-app"
version = "0.1.0"
type = "app"
license = "MIT"
author = "John Doe"

[build]

FieldDefaultDescription
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
targethostTarget 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_disablefalseDisable auto source discovery
inheritfalseInherit build from workspace root
clean[]Glob patterns for custom clean paths
out_dir""Custom output directory
workspace_onlyfalseWorkspace-only, not built standalone

Settings from raw config (not in typed struct):

  • pkg_config — list of pkg-config packages
  • ldscript — linker script path
  • build.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.