- Custom build flags: `build.cflags` and `build.ldflags`
- Recursive source discovery inside `src/`
- Path dependencies with auto include/lib resolution and `dcr.lock` generation (experimental)
- Add docs/index.md and docs/dcr-toml.md
This commit is contained in:
2026-02-22 15:04:02 +08:00
parent ff12ca2758
commit 210e82f026
18 changed files with 758 additions and 29 deletions

View File

@@ -114,8 +114,10 @@ Removes the `target` directory in the project root.
## Build Profiles
Two profiles are supported:
- `--debug` (default) - flags: `-O0 -g -Wall -Wextra -fno-omit-frame-pointer -DDEBUG`(Clang)
- `--release` - flags: `-O3 -DNDEBUG -march=native`(Clang)
- `--debug` (default) - built-in flags per compiler
- `--release` - built-in flags per compiler
Custom flags can be added in `dcr.toml` via `build.cflags` and `build.ldflags`.
## Configuration
The main project file is `dcr.toml`.
@@ -131,10 +133,15 @@ version = "0.1.0"
language = "c"
standard = "c11"
compiler = "clang"
# Optional custom flags
cflags = ["-Wall", "-Wextra"]
ldflags = ["-lm"]
[dependencies]
```
Path dependencies are supported. DCR will resolve them on build and generate `dcr.lock`.
## Requirements
- Rust toolchain (`rustc`, `cargo`) - for building DCR from source
- C compiler (`clang`, `gcc`, or 'cl'(msvc))