mirror of
https://github.com/dexoron/dcr.git
synced 2026-10-21 13:18:29 +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
2.0 KiB
2.0 KiB
dcr build
Builds the project in debug or release profile.
Usage
dcr build
dcr build --debug
dcr build --release
dcr build --release --force
dcr build --debug --clean
What build does
- Checks that
dcr.tomlexists and is valid. - Reads build settings from
[build]. - Resolves path dependencies from
[dependencies]. - Creates required output directories.
- Recursively compiles sources from
src/. - Links final artifact (binary or library).
Config values used
package.namebuild.compilerbuild.languagebuild.standardbuild.kindbuild.targetbuild.platformbuild.cflagsbuild.ldflagsbuild.debug/build.releasebuild.excludebuild.includebuild.pkg_configbuild.stepsbuild.post_stepsbuild.generatedbuild.expectbuild.clean
Source selection
language = "c"->*.clanguage = "c++" | "cpp" | "cxx"->*.cpp,*.cxx,*.cclanguage = "asm"->*.s,*.S,*.asm- Mixed languages are supported with arrays, for example
language = ["c", "asm"]. - By default sources are searched in
src/; usebuild.rootsandbuild.src_disableto override.
Notes
- The profile is selected from the first argument only.
- Unknown profile flags return an error.
- Incremental rebuild is based on source/object mtime comparison.
--forceskips build cache checks and recompiles.--cleanremovestarget/<profile>andbuild.cleanpaths before building.- For
language = "asm"withcompiler = "as"/"gas", use.sfiles (no preprocessing). For.S, usegccorclang. - In workspace root,
dcr buildbuilds all members in dependency order. build.excluderemoves paths from source/header collection;build.includere-allows matching paths and has priority overexclude.build.stepsrun before compilation;build.post_stepsrun after linking.build.generatedis cleaned whenbuild.stepsneed to rerun;build.expectis verified after post-steps.