mirror of
https://github.com/dexoron/dcr.git
synced 2026-10-21 16:19:37 +00:00
- `dcr gen` command for IDE integration and build tool support
- `dcr gen project-info`: Output project metadata as JSON
- `dcr gen compile-commands`: Generate `compile_commands.json` for clangd and clang-tidy
- `dcr gen vscode`: Generate VS Code `.vscode/` integration (launch.json, tasks.json, settings.json)
- `dcr gen clion`: Generate JetBrains CLion `.idea/` integration (run configurations, build targets)
- Full workspace support for all `gen` subcommands
3.1 KiB
3.1 KiB
Config reference
Full schema
[package]
name = "string" # required
version = "string" # required
[build]
language = "c|c++|cpp|cxx|asm" # required (string or array)
standard = "string" # required
compiler = "string" # required
kind = "bin|staticlib|sharedlib" # required
target = "string" # optional
platform = "string" # optional
cflags = ["string", "..."] # optional
ldflags = ["string", "..."] # optional
exclude = ["string", "..."] # optional
include = ["string", "..."] # optional
roots = ["string", "..."] # optional
src_disable = false # optional
pkg_config = ["string", "..."] # optional
generated = ["string", "..."] # optional
expect = ["string", "..."] # optional
clean = ["string", "..."] # optional
[[build.steps]]
name = "string"
in = "glob"
out = "path or glob"
cmd = "string"
[[build.post_steps]]
name = "string"
in = "glob"
out = "path or glob"
cmd = "string"
# Inline array form (equivalent to [[build.steps]] / [[build.post_steps]])
steps = [
{ name = "string", in = "glob", out = "path or glob", cmd = "string" },
]
post_steps = [
{ name = "string", in = "glob", out = "path or glob", cmd = "string" },
]
[build.debug]
cflags = ["string", "..."] # optional
ldflags = ["string", "..."] # optional
[build.release]
cflags = ["string", "..."] # optional
ldflags = ["string", "..."] # optional
[toolchain]
cc = "string" # optional
cxx = "string" # optional
as = "string" # optional
ar = "string" # optional
ld = "string" # optional
uic = "string" # optional
moc = "string" # optional
rcc = "string" # optional
[run]
cmd = "string" # optional
[workspace]
name = { path = "string", deps = ["string", "..."] }
[dependencies]
name = {
path = "string", # required for each dependency
include = ["string", "..."], # optional
lib = ["string", "..."], # optional
libs = ["string", "..."], # optional
}
Validation rules
[package],[build],[dependencies]must exist.- Required string fields must be non-empty.
build.kindmust bebin,staticlib, orsharedlib.- Dependency fields
include/lib/libsmust be string arrays when provided. build.exclude/build.includemust be string arrays when provided.build.rootsmust be a string array when provided.build.src_disablemust be boolean when provided.build.clean/build.generated/build.pkg_config/build.expectmust be string arrays when provided.build.debug/build.releasemust be tables; theircflags/ldflagsmust be string arrays.build.steps/build.post_stepsentries must includename,in,out,cmd.build.languagemay be a string or array (for example["c", "c++", "asm"]).[build.<profile>]tables inherit all base values and override any fields they specify. Array fields (likecflags/ldflags) are appended to the base array.
Generated defaults (dcr new / dcr init)
package.version = "0.1.0"build.language = "c"build.standard = "c11"build.compiler = "clang"build.kind = "bin"