New translations dcr-toml.mdx (Russian)

[ci skip]
This commit is contained in:
2026-07-18 20:08:42 +08:00
parent de0007d16c
commit 6000a27708

View File

@@ -37,13 +37,13 @@ Main project configuration file. Located at the project root.
## [package] ## [package]
| Field | Required | Description | | Field | Required | Description |
| --------- | -------- | ----------------------- | | --------- | -------- | ------------------------------------------- |
| `name` | yes | Project name | | `name` | yes | Project name |
| `version` | yes | Semantic version | | `version` | yes | Semantic version |
| `type` | yes | `app`, `lib`, `none` | | `type` | no | `app`, `lib`, `none` (defaults to `"none"`) |
| `license` | no | SPDX license identifier | | `license` | no | SPDX license identifier |
| `author` | no | Author | | `author` | no | Author |
```toml ```toml
[package] [package]
@@ -60,36 +60,36 @@ author = "John Doe"
* `build.qt` — (bool) Enable automatic Qt meta-object handling (MOC, UIC, RCC). Requires `qt6` modules installed via `pkg-config`. * `build.qt` — (bool) Enable automatic Qt meta-object handling (MOC, UIC, RCC). Requires `qt6` modules installed via `pkg-config`.
| Field | Default | Description | | Field | Default | Description |
| ---------------- | ------------------------------------------- | --------------------------------------------------------------------- | | ---------------- | ------------- | ---------------------------------------------------------------------------------------------------- |
| `language` | `"c"` | `"c"`, `"c++"`, `"cpp"`, `"cxx"`, `"asm"` | | `language` | `"c"` | `"c"`, `"c++"`, `"cpp"`, `"cxx"`, `"asm"` (optional, defaults to `"c"`) |
| `standard` | `"c11"` | C standard (`c11`, `c17`, `c23`) | | `standard` | `"c11"` | C standard (`c11`, `c17`, `c23`) |
| `cxx_standard` | `"c++20"` | C++ standard (`c++17`, `c++20`, `c++23`) | | `cxx_standard` | — | C++ standard (`c++17`, `c++20`, `c++23`) |
| `compiler` | `"clang"` | Preferred compiler | | `compiler` | `"clang"` | Preferred compiler (optional, defaults to `"clang"`) |
| `kind` | `"bin"` | `bin`, `staticlib`, `sharedlib`, `efi`, `elf`, `none`, `custom` | | `kind` | `"bin"` | `bin`, `staticlib`, `sharedlib`, `efi`, `elf`, `none`, `custom` |
| `target` | host | Target triple for cross-compilation | | `target` | host | Target triple for cross-compilation |
| `platform` | `"native"` | `native`, `efi` | | `platform` | `"native"` | `native`, `efi` |
| `cflags` | `[]` | Additional C/C++/ASM flags | | `cflags` | `[]` | Additional C/C++/ASM flags |
| `ldflags` | `[]` | Additional linker flags | | `ldflags` | `[]` | Additional linker flags |
| `filename` | `""` | Custom output file name | | `filename` | `""` | Custom output file name |
| `extension` | `""` | Custom file extension | | `extension` | `""` | Custom file extension |
| `roots` | `["src"]` | Source root directories | | `roots` | `["src"]` | Source root directories |
| `exclude` | `[]` | Exclude patterns | | `exclude` | `[]` | Exclude patterns |
| `include` | `[]` | Additional include directories | | `include` | `[]` | Additional include directories |
| `src_disable` | `false` | Disable auto source discovery | | `src_disable` | `false` | Disable auto source discovery |
| `inherit` | `false` | Inherit build from workspace root | | `inherit` | `false` | Inherit build from workspace root |
| `clean` | `[]` | Glob patterns for custom clean paths | | `clean` | `[]` | Glob patterns for custom clean paths |
| `out_dir` | `""` | Custom output directory | | `out_dir` | `""` | Custom output directory |
| `workspace_only` | `false` | Workspace-only, not built standalone | | `workspace_only` | `false` | Workspace-only, not built standalone (no `language`/`compiler` required) |
| `freestanding` | `false` | Compile in freestanding mode (`-ffreestanding` + `-nostdlib -static`) | | `freestanding` | `false` | Compile in freestanding mode (`-ffreestanding` + `-nostdlib -static`) |
| `opt_level` | `"0"` (debug) / `"3"` (release) | Optimization level: `0`-`3`, `"s"`, `"z"` | | `opt_level` | — | Optimization level: `0`-`3`, `"s"`, `"z"` (derived from profile if omitted) |
| `debug` | `true` (debug) / `false` (release) | Emit debug symbols (`-g`) | | `debug` | profile-based | Emit debug symbols (`-g`): `true` in debug, `false` in release |
| `lto` | `false` | Link-time optimization (`-flto` for both compiler and linker) | | `lto` | `false` | Link-time optimization (`-flto` for both compiler and linker) |
| `strip` | `false` | Strip symbols from output (`-s` in ldflags) | | `strip` | `false` | Strip symbols from output (`-s` in ldflags) |
| `warnings` | `["all", "extra"]` (debug) / `[]` (release) | Warning flags (e.g. `"all"`, `"extra"`, `"pedantic"`) | | `warnings` | `[]` | Warning flags (e.g. `"all"`, `"extra"`, `"pedantic"`); engine adds `-Wall -Wextra` in debug if empty |
| `panic` | `""` | Panic strategy: `"abort"` disables exceptions and unwind tables | | `panic` | `""` | Panic strategy: `"abort"` disables exceptions and unwind tables |
| `codegen-units` | `""` | Max parallel compilation jobs (`"0"` = auto) | | `codegen-units` | `""` | Max parallel compilation jobs (`"0"` = auto) |
| `qt` | `false` | Enable automatic Qt meta-object handling (MOC, UIC, RCC) | | `qt` | `false` | Enable automatic Qt meta-object handling (MOC, UIC, RCC) |
Settings from raw config (not in typed struct): Settings from raw config (not in typed struct):
@@ -97,6 +97,30 @@ Settings from raw config (not in typed struct):
* `ldscript` — linker script path * `ldscript` — linker script path
* `build.steps` / `build.post_steps` — codegen steps * `build.steps` / `build.post_steps` — codegen steps
## Per-language overrides: `[build.c]`, `[build.cxx]`, `[build.asm]`
Each language can have its own table that overrides the flat `[build]` settings:
```toml
[build]
compiler = "clang"
standard = "c11"
[build.c]
standard = "c23"
compiler = "gcc"
[build.cxx]
standard = "c++23"
compiler = "g++"
[build.asm]
compiler = "nasm"
flags = ["-felf64"]
```
The flat `[build]` acts as fallback; per-language tables take precedence for their language.
Example: Example:
```toml ```toml