mirror of
https://github.com/dexoron/dcr.git
synced 2026-10-22 13:59:37 +00:00
Compare commits
36 Commits
0e2d05788a
...
e72bc4e778
| Author | SHA1 | Date | |
|---|---|---|---|
| e72bc4e778 | |||
| 57cff02e58 | |||
| 6157f1d860 | |||
| 4868b5d0d0 | |||
| 2dc80ea281 | |||
| 80ec220477 | |||
| 7dc8d77e19 | |||
| aaba0d4f3d | |||
| f7bb1fee0f | |||
| 2d182e7259 | |||
| 02872886fd | |||
| a8538fe408 | |||
| 140dbe9469 | |||
| 7d23753199 | |||
| bdf4c0baee | |||
| 09dbd7f8e2 | |||
| 78151ff0de | |||
| 66797c2265 | |||
| b07ca1c0ac | |||
| 8ff841f2f5 | |||
| 54849b2c43 | |||
| 8dae42f8ea | |||
| 8edb16f1e4 | |||
| 6704c96b30 | |||
| 02ad12a902 | |||
| c7d5d135ca | |||
| 8998d19bce | |||
| d42eeee0ff | |||
| ba408c3dcc | |||
| 98068b54f7 | |||
| 5770d69128 | |||
| 80fc509997 | |||
| 05f16fc6b4 | |||
| e63175549c | |||
| 525bd52f8b | |||
| 9f97202121 |
@@ -12,8 +12,13 @@ Only ASCII letters, digits, underscores `_` and hyphens `-` are allowed in the p
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
dcr new my-app
|
dcr new my-app
|
||||||
|
dcr new my-app --vcs none
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Flags:
|
||||||
|
|
||||||
|
* `--vcs \<git|none>` — Initialize version control system (defaults to `git` if available, or `none`).
|
||||||
|
|
||||||
Generates:
|
Generates:
|
||||||
|
|
||||||
* `dcr.toml` with basic fields
|
* `dcr.toml` with basic fields
|
||||||
@@ -24,8 +29,12 @@ Generates:
|
|||||||
Initializes a DCR project in the current (empty) directory.
|
Initializes a DCR project in the current (empty) directory.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mkdir app && cd app
|
|
||||||
dcr init
|
dcr init
|
||||||
|
dcr init --vcs none
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Flags:
|
||||||
|
|
||||||
|
* `--vcs \<git|none>` — Initialize version control system (defaults to `git` if available, or `none`).
|
||||||
|
|
||||||
The project name is taken from the current directory name. The directory name must follow the same naming rules as `dcr new`.
|
The project name is taken from the current directory name. The directory name must follow the same naming rules as `dcr new`.
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ dcr setup
|
|||||||
If `~/.dcr/config.toml` is not found, DCR returns an error. Create it manually:
|
If `~/.dcr/config.toml` is not found, DCR returns an error. Create it manually:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[[registry]]
|
[registry.default]
|
||||||
name = "default"
|
|
||||||
url = "https://index.dcr.pm"
|
url = "https://index.dcr.pm"
|
||||||
|
priority = 1
|
||||||
```
|
```
|
||||||
|
|
||||||
## `dcr --help`
|
## `dcr --help`
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ error: registry not found
|
|||||||
**Solution:** Make sure `~/.dcr/config.toml` exists:
|
**Solution:** Make sure `~/.dcr/config.toml` exists:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[[registry]]
|
[registry.default]
|
||||||
name = "default"
|
|
||||||
url = "https://index.dcr.pm"
|
url = "https://index.dcr.pm"
|
||||||
|
priority = 1
|
||||||
```
|
```
|
||||||
|
|
||||||
And check `DCR_INDEX_PATH`:
|
And check `DCR_INDEX_PATH`:
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ man dcr-build
|
|||||||
To use the registry, create `~/.dcr/config.toml`:
|
To use the registry, create `~/.dcr/config.toml`:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[[registry]]
|
[registry.default]
|
||||||
name = "default"
|
|
||||||
url = "https://index.dcr.pm"
|
url = "https://index.dcr.pm"
|
||||||
|
priority = 1
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -10,36 +10,23 @@ DCR itself is [GPL-3.0-or-later](https://spdx.org/licenses/GPL-3.0-or-later.html
|
|||||||
|
|
||||||
> **Note:** DCR is a build tool, not a library. The GPL applies only to DCR's own source code. Projects built with DCR are not subject to DCR's license — their licensing is determined solely by their own code and dependencies.
|
> **Note:** DCR is a build tool, not a library. The GPL applies only to DCR's own source code. Projects built with DCR are not subject to DCR's license — their licensing is determined solely by their own code and dependencies.
|
||||||
|
|
||||||
## Vendored libraries
|
|
||||||
|
|
||||||
DCR statically links the following C libraries through its vendored Rust dependencies:
|
|
||||||
|
|
||||||
| Library | License | Bundled by |
|
|
||||||
| ------------------------------------------ | ------------------ | ----------------------------- |
|
|
||||||
| [libgit2](https://libgit2.org) | MIT OR Apache-2.0 | `git2` / `libgit2-sys` |
|
|
||||||
| [libssh2](https://libssh2.org) | MIT OR Apache-2.0 | `libgit2-sys` |
|
|
||||||
| [zlib](https://zlib.net) | MIT OR Apache-2.0 | `libgit2-sys` |
|
|
||||||
| [OpenSSL](https://openssl.org) | Apache-2.0 | `openssl-sys` / `openssl-src` |
|
|
||||||
| [ring](https://github.com/briansmith/ring) | Apache-2.0 AND ISC | `rustls` |
|
|
||||||
|
|
||||||
## Rust dependencies
|
## Rust dependencies
|
||||||
|
|
||||||
DCR is written in Rust. The following notable Rust crates are statically linked:
|
DCR is written in Rust. The following notable Rust crates are statically linked:
|
||||||
|
|
||||||
| Crate | License |
|
| Crate | License |
|
||||||
| --------------------------------------------- | ------------------------ |
|
| ------------------------------------------------------- | ----------------- |
|
||||||
| [`reqwest`](https://crates.io/crates/reqwest) | MIT OR Apache-2.0 |
|
| [`ureq`](https://crates.io/crates/ureq) | MIT OR Apache-2.0 |
|
||||||
| [`rustls`](https://crates.io/crates/rustls) | Apache-2.0 OR ISC OR MIT |
|
|
||||||
| [`serde`](https://crates.io/crates/serde) | MIT OR Apache-2.0 |
|
| [`serde`](https://crates.io/crates/serde) | MIT OR Apache-2.0 |
|
||||||
| [`toml`](https://crates.io/crates/toml) | MIT OR Apache-2.0 |
|
| [`toml`](https://crates.io/crates/toml) | MIT OR Apache-2.0 |
|
||||||
|
| [`toml_edit`](https://crates.io/crates/toml_edit) | MIT OR Apache-2.0 |
|
||||||
|
| [`serde_json`](https://crates.io/crates/serde_json) | MIT OR Apache-2.0 |
|
||||||
| [`sha2`](https://crates.io/crates/sha2) | MIT OR Apache-2.0 |
|
| [`sha2`](https://crates.io/crates/sha2) | MIT OR Apache-2.0 |
|
||||||
| [`git2`](https://crates.io/crates/git2) | MIT OR Apache-2.0 |
|
| [`glob`](https://crates.io/crates/glob) | MIT OR Apache-2.0 |
|
||||||
| [`openssl`](https://crates.io/crates/openssl) | Apache-2.0 |
|
| [`self-replace`](https://crates.io/crates/self-replace) | MIT OR Apache-2.0 |
|
||||||
| [`tokio`](https://crates.io/crates/tokio) | MIT |
|
|
||||||
| [`hyper`](https://crates.io/crates/hyper) | MIT |
|
|
||||||
| [`ctrlc`](https://crates.io/crates/ctrlc) | MIT OR Apache-2.0 |
|
| [`ctrlc`](https://crates.io/crates/ctrlc) | MIT OR Apache-2.0 |
|
||||||
|
|
||||||
Full dependency tree (143 packages) is available in [`Cargo.lock`](https://github.com/dexoron/dcr/blob/main/Cargo.lock). The overwhelming majority are dual-licensed under MIT OR Apache-2.0.
|
Full dependency tree is available in [`Cargo.lock`](https://github.com/dexoron/dcr/blob/main/Cargo.lock). The overwhelming majority are dual-licensed under MIT OR Apache-2.0.
|
||||||
|
|
||||||
## Additional credits
|
## Additional credits
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ type = "none"
|
|||||||
inherit = true
|
inherit = true
|
||||||
language = "c"
|
language = "c"
|
||||||
standard = "c11"
|
standard = "c11"
|
||||||
|
workspace_only = true
|
||||||
|
|
||||||
[workspace.lib-core]
|
[workspace.lib-core]
|
||||||
path = "lib-core"
|
path = "lib-core"
|
||||||
|
|||||||
@@ -38,10 +38,10 @@ 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 |
|
||||||
|
|
||||||
@@ -61,11 +61,11 @@ 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` |
|
||||||
@@ -80,13 +80,13 @@ author = "John Doe"
|
|||||||
| `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) |
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -41,24 +41,22 @@ DCR uses a package registry for dependency lookup by name.
|
|||||||
|
|
||||||
```toml
|
```toml
|
||||||
# ~/.dcr/config.toml
|
# ~/.dcr/config.toml
|
||||||
[[registry]]
|
[registry.default]
|
||||||
name = "default"
|
|
||||||
url = "https://index.dcr.pm"
|
url = "https://index.dcr.pm"
|
||||||
|
priority = 1
|
||||||
```
|
```
|
||||||
|
|
||||||
Registry priority: order in `config.toml`. The `DCR_INDEX_PATH` variable overrides the path to `index.json`.
|
Registry priority: order in `config.toml`. The `DCR_INDEX_PATH` variable overrides the path to `index.json`.
|
||||||
|
|
||||||
## Git dependencies
|
## Git dependencies
|
||||||
|
|
||||||
DCR clones git repositories via `git2`:
|
Git dependencies are parsed and recorded in `dcr.lock`. DCR supports specifying branch/tag/rev for git sources:
|
||||||
|
|
||||||
* `branch` — switch to a branch
|
* `branch` — switch to a branch
|
||||||
* `tag` — switch to a tag
|
* `tag` — switch to a tag
|
||||||
* `rev` — switch to a specific commit
|
* `rev` — switch to a specific commit
|
||||||
* `features` — feature flags (parsed, but does not affect build)
|
* `features` — feature flags (parsed, but does not affect build)
|
||||||
|
|
||||||
Cache path: `~/.dcr/git/\<hash>/`.
|
|
||||||
|
|
||||||
## Path dependencies
|
## Path dependencies
|
||||||
|
|
||||||
Local paths. DCR automatically discovers include and lib directories from the neighbor's `dcr.toml`.
|
Local paths. DCR automatically discovers include and lib directories from the neighbor's `dcr.toml`.
|
||||||
|
|||||||
@@ -65,3 +65,21 @@ standard = "c17"
|
|||||||
|
|
||||||
# member inherits language and standard
|
# member inherits language and standard
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Workspace-only root (no build of its own)
|
||||||
|
|
||||||
|
A workspace root can set `workspace_only = true` — it won't be built itself, and doesn't need `language` or `compiler`:
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[package]
|
||||||
|
name = "my-workspace"
|
||||||
|
version = "0.1.0"
|
||||||
|
|
||||||
|
[build]
|
||||||
|
workspace_only = true
|
||||||
|
kind = "bin"
|
||||||
|
|
||||||
|
[workspace]
|
||||||
|
lib-core = { path = "lib-core" }
|
||||||
|
app = { path = "app", deps = ["lib-core"] }
|
||||||
|
```
|
||||||
|
|||||||
@@ -12,8 +12,13 @@ Only ASCII letters, digits, underscores `_` and hyphens `-` are allowed in the p
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
dcr new my-app
|
dcr new my-app
|
||||||
|
dcr new my-app --vcs none
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Flags:
|
||||||
|
|
||||||
|
* `--vcs \<git|none>` — Initialize version control system (defaults to `git` if available, or `none`).
|
||||||
|
|
||||||
Generates:
|
Generates:
|
||||||
|
|
||||||
* `dcr.toml` with basic fields
|
* `dcr.toml` with basic fields
|
||||||
@@ -24,8 +29,12 @@ Generates:
|
|||||||
Initializes a DCR project in the current (empty) directory.
|
Initializes a DCR project in the current (empty) directory.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mkdir app && cd app
|
|
||||||
dcr init
|
dcr init
|
||||||
|
dcr init --vcs none
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Flags:
|
||||||
|
|
||||||
|
* `--vcs \<git|none>` — Initialize version control system (defaults to `git` if available, or `none`).
|
||||||
|
|
||||||
The project name is taken from the current directory name. The directory name must follow the same naming rules as `dcr new`.
|
The project name is taken from the current directory name. The directory name must follow the same naming rules as `dcr new`.
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ dcr setup
|
|||||||
If `~/.dcr/config.toml` is not found, DCR returns an error. Create it manually:
|
If `~/.dcr/config.toml` is not found, DCR returns an error. Create it manually:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[[registry]]
|
[registry.default]
|
||||||
name = "default"
|
|
||||||
url = "https://index.dcr.pm"
|
url = "https://index.dcr.pm"
|
||||||
|
priority = 1
|
||||||
```
|
```
|
||||||
|
|
||||||
## `dcr --help`
|
## `dcr --help`
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ error: registry not found
|
|||||||
**Solution:** Make sure `~/.dcr/config.toml` exists:
|
**Solution:** Make sure `~/.dcr/config.toml` exists:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[[registry]]
|
[registry.default]
|
||||||
name = "default"
|
|
||||||
url = "https://index.dcr.pm"
|
url = "https://index.dcr.pm"
|
||||||
|
priority = 1
|
||||||
```
|
```
|
||||||
|
|
||||||
And check `DCR_INDEX_PATH`:
|
And check `DCR_INDEX_PATH`:
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ man dcr-build
|
|||||||
To use the registry, create `~/.dcr/config.toml`:
|
To use the registry, create `~/.dcr/config.toml`:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[[registry]]
|
[registry.default]
|
||||||
name = "default"
|
|
||||||
url = "https://index.dcr.pm"
|
url = "https://index.dcr.pm"
|
||||||
|
priority = 1
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -10,36 +10,23 @@ DCR itself is [GPL-3.0-or-later](https://spdx.org/licenses/GPL-3.0-or-later.html
|
|||||||
|
|
||||||
> **Note:** DCR is a build tool, not a library. The GPL applies only to DCR's own source code. Projects built with DCR are not subject to DCR's license — their licensing is determined solely by their own code and dependencies.
|
> **Note:** DCR is a build tool, not a library. The GPL applies only to DCR's own source code. Projects built with DCR are not subject to DCR's license — their licensing is determined solely by their own code and dependencies.
|
||||||
|
|
||||||
## Vendored libraries
|
|
||||||
|
|
||||||
DCR statically links the following C libraries through its vendored Rust dependencies:
|
|
||||||
|
|
||||||
| Library | License | Bundled by |
|
|
||||||
| ------------------------------------------ | ------------------ | ----------------------------- |
|
|
||||||
| [libgit2](https://libgit2.org) | MIT OR Apache-2.0 | `git2` / `libgit2-sys` |
|
|
||||||
| [libssh2](https://libssh2.org) | MIT OR Apache-2.0 | `libgit2-sys` |
|
|
||||||
| [zlib](https://zlib.net) | MIT OR Apache-2.0 | `libgit2-sys` |
|
|
||||||
| [OpenSSL](https://openssl.org) | Apache-2.0 | `openssl-sys` / `openssl-src` |
|
|
||||||
| [ring](https://github.com/briansmith/ring) | Apache-2.0 AND ISC | `rustls` |
|
|
||||||
|
|
||||||
## Rust dependencies
|
## Rust dependencies
|
||||||
|
|
||||||
DCR is written in Rust. The following notable Rust crates are statically linked:
|
DCR is written in Rust. The following notable Rust crates are statically linked:
|
||||||
|
|
||||||
| Crate | License |
|
| Crate | License |
|
||||||
| --------------------------------------------- | ------------------------ |
|
| ------------------------------------------------------- | ----------------- |
|
||||||
| [`reqwest`](https://crates.io/crates/reqwest) | MIT OR Apache-2.0 |
|
| [`ureq`](https://crates.io/crates/ureq) | MIT OR Apache-2.0 |
|
||||||
| [`rustls`](https://crates.io/crates/rustls) | Apache-2.0 OR ISC OR MIT |
|
|
||||||
| [`serde`](https://crates.io/crates/serde) | MIT OR Apache-2.0 |
|
| [`serde`](https://crates.io/crates/serde) | MIT OR Apache-2.0 |
|
||||||
| [`toml`](https://crates.io/crates/toml) | MIT OR Apache-2.0 |
|
| [`toml`](https://crates.io/crates/toml) | MIT OR Apache-2.0 |
|
||||||
|
| [`toml_edit`](https://crates.io/crates/toml_edit) | MIT OR Apache-2.0 |
|
||||||
|
| [`serde_json`](https://crates.io/crates/serde_json) | MIT OR Apache-2.0 |
|
||||||
| [`sha2`](https://crates.io/crates/sha2) | MIT OR Apache-2.0 |
|
| [`sha2`](https://crates.io/crates/sha2) | MIT OR Apache-2.0 |
|
||||||
| [`git2`](https://crates.io/crates/git2) | MIT OR Apache-2.0 |
|
| [`glob`](https://crates.io/crates/glob) | MIT OR Apache-2.0 |
|
||||||
| [`openssl`](https://crates.io/crates/openssl) | Apache-2.0 |
|
| [`self-replace`](https://crates.io/crates/self-replace) | MIT OR Apache-2.0 |
|
||||||
| [`tokio`](https://crates.io/crates/tokio) | MIT |
|
|
||||||
| [`hyper`](https://crates.io/crates/hyper) | MIT |
|
|
||||||
| [`ctrlc`](https://crates.io/crates/ctrlc) | MIT OR Apache-2.0 |
|
| [`ctrlc`](https://crates.io/crates/ctrlc) | MIT OR Apache-2.0 |
|
||||||
|
|
||||||
Full dependency tree (143 packages) is available in [`Cargo.lock`](https://github.com/dexoron/dcr/blob/main/Cargo.lock). The overwhelming majority are dual-licensed under MIT OR Apache-2.0.
|
Full dependency tree is available in [`Cargo.lock`](https://github.com/dexoron/dcr/blob/main/Cargo.lock). The overwhelming majority are dual-licensed under MIT OR Apache-2.0.
|
||||||
|
|
||||||
## Additional credits
|
## Additional credits
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ type = "none"
|
|||||||
inherit = true
|
inherit = true
|
||||||
language = "c"
|
language = "c"
|
||||||
standard = "c11"
|
standard = "c11"
|
||||||
|
workspace_only = true
|
||||||
|
|
||||||
[workspace.lib-core]
|
[workspace.lib-core]
|
||||||
path = "lib-core"
|
path = "lib-core"
|
||||||
|
|||||||
@@ -38,10 +38,10 @@ 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 |
|
||||||
|
|
||||||
@@ -61,11 +61,11 @@ 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` |
|
||||||
@@ -80,13 +80,13 @@ author = "John Doe"
|
|||||||
| `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) |
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -41,24 +41,22 @@ DCR uses a package registry for dependency lookup by name.
|
|||||||
|
|
||||||
```toml
|
```toml
|
||||||
# ~/.dcr/config.toml
|
# ~/.dcr/config.toml
|
||||||
[[registry]]
|
[registry.default]
|
||||||
name = "default"
|
|
||||||
url = "https://index.dcr.pm"
|
url = "https://index.dcr.pm"
|
||||||
|
priority = 1
|
||||||
```
|
```
|
||||||
|
|
||||||
Registry priority: order in `config.toml`. The `DCR_INDEX_PATH` variable overrides the path to `index.json`.
|
Registry priority: order in `config.toml`. The `DCR_INDEX_PATH` variable overrides the path to `index.json`.
|
||||||
|
|
||||||
## Git dependencies
|
## Git dependencies
|
||||||
|
|
||||||
DCR clones git repositories via `git2`:
|
Git dependencies are parsed and recorded in `dcr.lock`. DCR supports specifying branch/tag/rev for git sources:
|
||||||
|
|
||||||
* `branch` — switch to a branch
|
* `branch` — switch to a branch
|
||||||
* `tag` — switch to a tag
|
* `tag` — switch to a tag
|
||||||
* `rev` — switch to a specific commit
|
* `rev` — switch to a specific commit
|
||||||
* `features` — feature flags (parsed, but does not affect build)
|
* `features` — feature flags (parsed, but does not affect build)
|
||||||
|
|
||||||
Cache path: `~/.dcr/git/\<hash>/`.
|
|
||||||
|
|
||||||
## Path dependencies
|
## Path dependencies
|
||||||
|
|
||||||
Local paths. DCR automatically discovers include and lib directories from the neighbor's `dcr.toml`.
|
Local paths. DCR automatically discovers include and lib directories from the neighbor's `dcr.toml`.
|
||||||
|
|||||||
@@ -65,3 +65,21 @@ standard = "c17"
|
|||||||
|
|
||||||
# member inherits language and standard
|
# member inherits language and standard
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Workspace-only root (no build of its own)
|
||||||
|
|
||||||
|
A workspace root can set `workspace_only = true` — it won't be built itself, and doesn't need `language` or `compiler`:
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[package]
|
||||||
|
name = "my-workspace"
|
||||||
|
version = "0.1.0"
|
||||||
|
|
||||||
|
[build]
|
||||||
|
workspace_only = true
|
||||||
|
kind = "bin"
|
||||||
|
|
||||||
|
[workspace]
|
||||||
|
lib-core = { path = "lib-core" }
|
||||||
|
app = { path = "app", deps = ["lib-core"] }
|
||||||
|
```
|
||||||
|
|||||||
@@ -12,8 +12,13 @@ sidebar_label: Команды проекта (new, init)
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
dcr new my-app
|
dcr new my-app
|
||||||
|
dcr new my-app --vcs none
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Flags:
|
||||||
|
|
||||||
|
* `--vcs \<git|none>` — Initialize version control system (defaults to `git` if available, or `none`).
|
||||||
|
|
||||||
Генерирует:
|
Генерирует:
|
||||||
|
|
||||||
* `dcr.toml` с базовыми полями
|
* `dcr.toml` с базовыми полями
|
||||||
@@ -24,8 +29,12 @@ dcr new my-app
|
|||||||
Инициализирует проект DCR в текущем (пустом) каталоге.
|
Инициализирует проект DCR в текущем (пустом) каталоге.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mkdir app && cd app
|
|
||||||
dcr init
|
dcr init
|
||||||
|
dcr init --vcs none
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Flags:
|
||||||
|
|
||||||
|
* `--vcs \<git|none>` — Initialize version control system (defaults to `git` if available, or `none`).
|
||||||
|
|
||||||
Название проекта взято из имени текущего каталога. Имя каталога должно соответствовать тем же правилам именования, что и в `dcr new`.
|
Название проекта взято из имени текущего каталога. Имя каталога должно соответствовать тем же правилам именования, что и в `dcr new`.
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ dcr setup
|
|||||||
Если файл `~/.dcr/config.toml` не найден, DCR возвращает ошибку. Создайте его вручную:
|
Если файл `~/.dcr/config.toml` не найден, DCR возвращает ошибку. Создайте его вручную:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[[registry]]
|
[registry.default]
|
||||||
name = "default"
|
|
||||||
url = "https://index.dcr.pm"
|
url = "https://index.dcr.pm"
|
||||||
|
priority = 1
|
||||||
```
|
```
|
||||||
|
|
||||||
## `dcr --help`
|
## `dcr --help`
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ sidebar_label: Часто задаваемые вопросы
|
|||||||
**Решение:** Убедитесь, что файл `~/.dcr/config.toml` существует:
|
**Решение:** Убедитесь, что файл `~/.dcr/config.toml` существует:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[[реестр]]
|
[registry.default]
|
||||||
name = "default"
|
|
||||||
url = "https://index.dcr.pm"
|
url = "https://index.dcr.pm"
|
||||||
|
priority = 1
|
||||||
```
|
```
|
||||||
|
|
||||||
Если реестр кастомный, проверьте `DCR_INDEX_PATH`:
|
Если реестр кастомный, проверьте `DCR_INDEX_PATH`:
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ man dcr-build
|
|||||||
Чтобы использовать реестр, создайте файл `~/.dcr/config.toml`:
|
Чтобы использовать реестр, создайте файл `~/.dcr/config.toml`:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[[registry]]
|
[registry.default]
|
||||||
name = "default"
|
|
||||||
url = "https://index.dcr.pm"
|
url = "https://index.dcr.pm"
|
||||||
|
priority = 1
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -10,36 +10,23 @@ DCR распространяется под лицензией [GPL-3.0-or-later
|
|||||||
|
|
||||||
> **Важно:** DCR — инструмент сборки, а не библиотека. GPL распространяется только на исходный код самого DCR. Проекты, собранные с помощью DCR, не подпадают под лицензию DCR — их лицензирование определяется исключительно их собственным кодом и зависимостями.
|
> **Важно:** DCR — инструмент сборки, а не библиотека. GPL распространяется только на исходный код самого DCR. Проекты, собранные с помощью DCR, не подпадают под лицензию DCR — их лицензирование определяется исключительно их собственным кодом и зависимостями.
|
||||||
|
|
||||||
## Вендорные библиотеки
|
|
||||||
|
|
||||||
DCR статически связывает следующие C-библиотеки через вендорные Rust-зависимости:
|
|
||||||
|
|
||||||
| Библиотека | Лицензия | В комплекте с |
|
|
||||||
| -------------------------------------------- | ------------------ | ----------------------------- |
|
|
||||||
| [libgit2](https://libgit2.org) | MIT ИЛИ Apache-2.0 | `git2` / `libgit2-sys` |
|
|
||||||
| [libssh2](https://libssh2.org) | MIT ИЛИ Apache-2.0 | `libgit2-sys` |
|
|
||||||
| [zlib](https://zlib.net) | MIT ИЛИ Apache-2.0 | `libgit2-sys` |
|
|
||||||
| [OpenSSL](https://openssl.org) | Apache-2.0 | `openssl-sys` / `openssl-src` |
|
|
||||||
| [кольцо](https://github.com/briansmith/ring) | Apache-2.0 И ISC | `rustls` |
|
|
||||||
|
|
||||||
## Rust-зависимости
|
## Rust-зависимости
|
||||||
|
|
||||||
DCR написан на Rust. Ниже перечислены основные статически связываемые крейты:
|
DCR написан на Rust. Ниже перечислены основные статически связываемые крейты:
|
||||||
|
|
||||||
| Крейт | Лицензия |
|
| Крейт | Лицензия |
|
||||||
| --------------------------------------------- | -------------------------- |
|
| ------------------------------------------------------- | ------------------ |
|
||||||
| [`reqwest`](https://crates.io/crates/reqwest) | MIT ИЛИ Apache-2.0 |
|
| [`ureq`](https://crates.io/crates/ureq) | MIT ИЛИ Apache-2.0 |
|
||||||
| [`rustls`](https://crates.io/crates/rustls) | Apache-2.0 ИЛИ ISC ИЛИ MIT |
|
|
||||||
| [`serde`](https://crates.io/crates/serde) | MIT ИЛИ Apache-2.0 |
|
| [`serde`](https://crates.io/crates/serde) | MIT ИЛИ Apache-2.0 |
|
||||||
| [`toml`](https://crates.io/crates/toml) | MIT ИЛИ Apache-2.0 |
|
| [`toml`](https://crates.io/crates/toml) | MIT ИЛИ Apache-2.0 |
|
||||||
|
| [`toml_edit`](https://crates.io/crates/toml_edit) | MIT OR Apache-2.0 |
|
||||||
|
| [`serde_json`](https://crates.io/crates/serde_json) | MIT ИЛИ Apache-2.0 |
|
||||||
| [`sha2`](https://crates.io/crates/sha2) | MIT ИЛИ Apache-2.0 |
|
| [`sha2`](https://crates.io/crates/sha2) | MIT ИЛИ Apache-2.0 |
|
||||||
| [`git2`](https://crates.io/crates/git2) | MIT ИЛИ Apache-2.0 |
|
| [`glob`](https://crates.io/crates/glob) | MIT ИЛИ Apache-2.0 |
|
||||||
| [`openssl`](https://crates.io/crates/openssl) | Apache-2.0 |
|
| [`self-replace`](https://crates.io/crates/self-replace) | MIT ИЛИ Apache-2.0 |
|
||||||
| [`tokio`](https://crates.io/crates/tokio) | MIT |
|
|
||||||
| [`hyper`](https://crates.io/crates/hyper) | MIT |
|
|
||||||
| [`ctrlc`](https://crates.io/crates/ctrlc) | MIT ИЛИ Apache-2.0 |
|
| [`ctrlc`](https://crates.io/crates/ctrlc) | MIT ИЛИ Apache-2.0 |
|
||||||
|
|
||||||
Полное дерево зависимостей (143 пакета) доступно в [`Cargo.lock`](https://github.com/dexoron/dcr/blob/main/Cargo.lock). Подавляющее большинство имеют двойную лицензию MIT OR Apache-2.0.
|
Full dependency tree is available in [`Cargo.lock`](https://github.com/dexoron/dcr/blob/main/Cargo.lock). Подавляющее большинство имеют двойную лицензию MIT OR Apache-2.0.
|
||||||
|
|
||||||
## Дополнительные благодарности
|
## Дополнительные благодарности
|
||||||
|
|
||||||
|
|||||||
@@ -33,14 +33,20 @@ type = "none"
|
|||||||
[build]
|
[build]
|
||||||
inherit = true
|
inherit = true
|
||||||
language = "c"
|
language = "c"
|
||||||
standard = "c17"
|
standard = "c11"
|
||||||
|
workspace_only = true
|
||||||
|
|
||||||
[workspace]
|
[workspace.lib-core]
|
||||||
members = [
|
path = "lib-core"
|
||||||
{ path = "lib-core" },
|
|
||||||
{ path = "lib-utils", deps = ["lib-core"] },
|
[workspace.lib-utils]
|
||||||
{ path = "app", deps = ["lib-core", "lib-utils"], main = true },
|
path = "lib-utils"
|
||||||
]
|
deps = ["lib-core"]
|
||||||
|
|
||||||
|
[workspace.app]
|
||||||
|
path = "app"
|
||||||
|
deps = ["lib-core", "lib-utils"]
|
||||||
|
main = true
|
||||||
```
|
```
|
||||||
|
|
||||||
## Пакеты
|
## Пакеты
|
||||||
|
|||||||
@@ -39,10 +39,10 @@ sidebar_label: Обзор dcr.toml
|
|||||||
## [пакет]
|
## [пакет]
|
||||||
|
|
||||||
| Поле | Обязательное | Описание |
|
| Поле | Обязательное | Описание |
|
||||||
| ---------- | ------------ | --------------------------- |
|
| ---------- | ------------ | ------------------------------------------- |
|
||||||
| `имя` | да | Имя проекта |
|
| `имя` | да | Имя проекта |
|
||||||
| `версия` | да | Семантическая версия |
|
| `версия` | да | Семантическая версия |
|
||||||
| `тип` | да | `app`, `lib`, `none` |
|
| `тип` | no | `app`, `lib`, `none` (defaults to `"none"`) |
|
||||||
| `лицензия` | нет | SPDX-идентификатор лицензии |
|
| `лицензия` | нет | SPDX-идентификатор лицензии |
|
||||||
| `автор` | нет | Автор |
|
| `автор` | нет | Автор |
|
||||||
|
|
||||||
@@ -62,11 +62,11 @@ author = "John Doe"
|
|||||||
* `build.qt` — (bool) Включить автоматическую обработку метаобъектов Qt (MOC, UIC, RCC). Требуется установка модулей `qt6` с помощью `pkg-config`.
|
* `build.qt` — (bool) Включить автоматическую обработку метаобъектов Qt (MOC, UIC, RCC). Требуется установка модулей `qt6` с помощью `pkg-config`.
|
||||||
|
|
||||||
| Поле | По умолчанию | Описание |
|
| Поле | По умолчанию | Описание |
|
||||||
| ------------------------ | --------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
|
| ------------------------ | ------------- | ---------------------------------------------------------------------------------------------------- |
|
||||||
| `язык` | `"c"` | `"c"`, `"cxx"`, `"cpp"` |
|
| `язык` | `"c"` | `"c"`, `"c++"`, `"cpp"`, `"cxx"`, `"asm"` (optional, defaults to `"c"`) |
|
||||||
| `стандартный` | `"c11"` | Стандарт C (`c11`, `c17`, `c23`) |
|
| `стандартный` | `"c11"` | Стандарт C (`c11`, `c17`, `c23`) |
|
||||||
| `cxx_standard` | `"c++20"` | Стандарт C++ (`c++17`, `c++20`, `c++23`) |
|
| `cxx_standard` | — | Стандарт C++ (`c++17`, `c++20`, `c++23`) |
|
||||||
| `компилятор` | `cxxflags` | Предпочитаемый компилятор |
|
| `компилятор` | `cxxflags` | Preferred compiler (optional, defaults to `"clang"`) |
|
||||||
| `тип` | `"bin"` | `bin`, `staticlib`, `sharedlib`, `efi`, `elf`, `none`, `custom` |
|
| `тип` | `"bin"` | `bin`, `staticlib`, `sharedlib`, `efi`, `elf`, `none`, `custom` |
|
||||||
| `target` | хост | Target triple для кросс-компиляции |
|
| `target` | хост | Target triple для кросс-компиляции |
|
||||||
| `платформа` | `"нативный"` | `native`, `efi`, `freestanding` |
|
| `платформа` | `"нативный"` | `native`, `efi`, `freestanding` |
|
||||||
@@ -81,13 +81,13 @@ author = "John Doe"
|
|||||||
| `наследовать` | `false` | Наследовать build от корня workspace |
|
| `наследовать` | `false` | Наследовать build от корня workspace |
|
||||||
| `clean` | `[]` | Шаблоны Glob для настраиваемых чистых путей |
|
| `clean` | `[]` | Шаблоны Glob для настраиваемых чистых путей |
|
||||||
| `out_dir` | `""` | Пользовательский каталог для вывода данных |
|
| `out_dir` | `""` | Пользовательский каталог для вывода данных |
|
||||||
| `только рабочая область` | `false` | Только для workspace, не собирать отдельно |
|
| `только рабочая область` | `false` | Workspace-only, not built standalone (no `language`/`compiler` required) |
|
||||||
| `отдельно стоящий` | `false` | Компилировать в автономном режиме (`-ffreestanding` + `-nostdlib -static`) |
|
| `отдельно стоящий` | `false` | Компилировать в автономном режиме (`-ffreestanding` + `-nostdlib -static`) |
|
||||||
| `opt_level` | `"0"` (отладочная версия) / `"3"` (релизная версия) | Уровень оптимизации: `0`–`3`, `"s"`, `"z"` |
|
| `opt_level` | — | Optimization level: `0`-`3`, `"s"`, `"z"` (derived from profile if omitted) |
|
||||||
| `ldscript` | `true` (отладочный режим) / `false` (релизный режим) | Выводить отладочные символы (`-g`) |
|
| `ldscript` | profile-based | Emit debug symbols (`-g`): `true` in debug, `false` in release |
|
||||||
| `lto` | `false` | Оптимизация на этапе компоновки (`-flto` как для компилятора, так и для компоновщика) |
|
| `lto` | `false` | Оптимизация на этапе компоновки (`-flto` как для компилятора, так и для компоновщика) |
|
||||||
| `asflags` | `false` | Удалить символы из вывода (опция `-s` в ldflags) |
|
| `asflags` | `false` | Удалить символы из вывода (опция `-s` в ldflags) |
|
||||||
| `true` | `["all", "extra"]` (отладочная версия) / `[]` (релизная версия) | Флаги предупреждений (например, `"all"`, `"extra"`, `"pedantic"`) |
|
| `true` | `[]` | Warning flags (e.g. `"all"`, `"extra"`, `"pedantic"`); engine adds `-Wall -Wextra` in debug if empty |
|
||||||
| `panic` | `""` | Стратегия «Паника»: `"abort"` отключает исключения и таблицы развертки |
|
| `panic` | `""` | Стратегия «Паника»: `"abort"` отключает исключения и таблицы развертки |
|
||||||
| `codegen-units` | `""` | Максимальное количество параллельных заданий компиляции (`"0"` = автоматически) |
|
| `codegen-units` | `""` | Максимальное количество параллельных заданий компиляции (`"0"` = автоматически) |
|
||||||
| `qt` | `false` | Включить автоматическую обработку метаобъектов Qt (MOC, UIC, RCC) |
|
| `qt` | `false` | Включить автоматическую обработку метаобъектов Qt (MOC, UIC, RCC) |
|
||||||
@@ -98,6 +98,30 @@ author = "John Doe"
|
|||||||
* Путь к linker script
|
* Путь к linker script
|
||||||
* `build.steps` / `build.post_steps` — этапы генерации кода
|
* `build.steps` / `build.post_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.
|
||||||
|
|
||||||
Пример:
|
Пример:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
|
|||||||
@@ -45,27 +45,25 @@ main = { url = "https://github.com/dcr-ports/dcr-index", priority = 1 }
|
|||||||
|
|
||||||
```toml
|
```toml
|
||||||
# ~/.dcr/config.toml
|
# ~/.dcr/config.toml
|
||||||
[[registry]]
|
[registry.default]
|
||||||
name = "default"
|
|
||||||
url = "https://index.dcr.pm"
|
url = "https://index.dcr.pm"
|
||||||
|
priority = 1
|
||||||
```
|
```
|
||||||
|
|
||||||
Приоритет реестра: порядок в файле `config.toml`. Переменная `DCR_INDEX_PATH` переопределяет путь к index.json.
|
Приоритет реестра: порядок в файле `config.toml`. Переменная `DCR_INDEX_PATH` переопределяет путь к index.json.
|
||||||
|
|
||||||
## Git-зависимости
|
## Git-зависимости
|
||||||
|
|
||||||
При добавлении git-зависимости DCR клонирует репозиторий через `git2`:
|
Git dependencies are parsed and recorded in `dcr.lock`. DCR supports specifying branch/tag/rev for git sources:
|
||||||
|
|
||||||
* `branch` — переключиться на ветку
|
* `branch` — переключиться на ветку
|
||||||
* `tag` — переключиться на тег
|
* `tag` — переключиться на тег
|
||||||
* `rev` — переключиться на конкретный коммит
|
* `rev` — переключиться на конкретный коммит
|
||||||
* `features` — флаги функций (проанализированы, но не влияют на сборку)
|
* `features` — флаги функций (проанализированы, но не влияют на сборку)
|
||||||
|
|
||||||
Путь к кэшу: `~/.dcr/git/\<hash>/`.
|
## Path dependencies
|
||||||
|
|
||||||
## Path-зависимости
|
Local paths. DCR automatically discovers include and lib directories from the neighbor's `dcr.toml`.
|
||||||
|
|
||||||
Локальные пути. DCR автоматически находит include и lib директории.
|
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[dependencies]
|
[dependencies]
|
||||||
@@ -75,14 +73,14 @@ mylib = { path = "../relative/path" }
|
|||||||
|
|
||||||
## dcr.lock
|
## dcr.lock
|
||||||
|
|
||||||
Файл блокировки зависимостей. Содержит точные версии, хеши и источники.
|
Dependency lock file. Contains package names and sources.
|
||||||
|
|
||||||
Создаётся при выполнении команды `dcr build` при наличии зависимостей реестра. Автоматически обновляется при `dcr add`.
|
Created during `dcr build` when registry dependencies are present. Not updated during `dcr add` — only on the next `dcr build`.
|
||||||
|
|
||||||
## Процесс резолва
|
## Resolution process
|
||||||
|
|
||||||
1. Загружаются все зависимости (registry → git → path)
|
1. Load all dependencies (registry → git → path)
|
||||||
2. Для зависимостей типа «path»: рекурсивно прочитать их файлы `dcr.toml`
|
2. For path deps: recursively read their `dcr.toml`
|
||||||
3. Для зависимостей реестра: выполните поиск в файле `index.json`
|
3. For registry deps: search `index.json`
|
||||||
4. Для зависимостей Git: клонировать в кэш
|
4. For git deps: clone to cache
|
||||||
5. Собираются include_dirs, lib_dirs, libs для передачи компилятору
|
5. Collect `include_dirs`, `lib_dirs`, `libs` for the compiler
|
||||||
|
|||||||
@@ -57,3 +57,21 @@ inherit = true
|
|||||||
language = "c"
|
language = "c"
|
||||||
standard = "c17"
|
standard = "c17"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Workspace-only root (no build of its own)
|
||||||
|
|
||||||
|
A workspace root can set `workspace_only = true` — it won't be built itself, and doesn't need `language` or `compiler`:
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[package]
|
||||||
|
name = "my-workspace"
|
||||||
|
version = "0.1.0"
|
||||||
|
|
||||||
|
[build]
|
||||||
|
workspace_only = true
|
||||||
|
kind = "bin"
|
||||||
|
|
||||||
|
[workspace]
|
||||||
|
lib-core = { path = "lib-core" }
|
||||||
|
app = { path = "app", deps = ["lib-core"] }
|
||||||
|
```
|
||||||
|
|||||||
@@ -12,8 +12,13 @@ Only ASCII letters, digits, underscores `_` and hyphens `-` are allowed in the p
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
dcr new my-app
|
dcr new my-app
|
||||||
|
dcr new my-app --vcs none
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Flags:
|
||||||
|
|
||||||
|
* `--vcs \<git|none>` — Initialize version control system (defaults to `git` if available, or `none`).
|
||||||
|
|
||||||
Generates:
|
Generates:
|
||||||
|
|
||||||
* `dcr.toml` with basic fields
|
* `dcr.toml` with basic fields
|
||||||
@@ -24,8 +29,12 @@ Generates:
|
|||||||
Initializes a DCR project in the current (empty) directory.
|
Initializes a DCR project in the current (empty) directory.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mkdir app && cd app
|
|
||||||
dcr init
|
dcr init
|
||||||
|
dcr init --vcs none
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Flags:
|
||||||
|
|
||||||
|
* `--vcs \<git|none>` — Initialize version control system (defaults to `git` if available, or `none`).
|
||||||
|
|
||||||
The project name is taken from the current directory name. The directory name must follow the same naming rules as `dcr new`.
|
The project name is taken from the current directory name. The directory name must follow the same naming rules as `dcr new`.
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ dcr setup
|
|||||||
If `~/.dcr/config.toml` is not found, DCR returns an error. Create it manually:
|
If `~/.dcr/config.toml` is not found, DCR returns an error. Create it manually:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[[registry]]
|
[registry.default]
|
||||||
name = "default"
|
|
||||||
url = "https://index.dcr.pm"
|
url = "https://index.dcr.pm"
|
||||||
|
priority = 1
|
||||||
```
|
```
|
||||||
|
|
||||||
## `dcr --help`
|
## `dcr --help`
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ error: registry not found
|
|||||||
**Solution:** Make sure `~/.dcr/config.toml` exists:
|
**Solution:** Make sure `~/.dcr/config.toml` exists:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[[registry]]
|
[registry.default]
|
||||||
name = "default"
|
|
||||||
url = "https://index.dcr.pm"
|
url = "https://index.dcr.pm"
|
||||||
|
priority = 1
|
||||||
```
|
```
|
||||||
|
|
||||||
And check `DCR_INDEX_PATH`:
|
And check `DCR_INDEX_PATH`:
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ man dcr-build
|
|||||||
To use the registry, create `~/.dcr/config.toml`:
|
To use the registry, create `~/.dcr/config.toml`:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[[registry]]
|
[registry.default]
|
||||||
name = "default"
|
|
||||||
url = "https://index.dcr.pm"
|
url = "https://index.dcr.pm"
|
||||||
|
priority = 1
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -10,36 +10,23 @@ DCR itself is [GPL-3.0-or-later](https://spdx.org/licenses/GPL-3.0-or-later.html
|
|||||||
|
|
||||||
> **Note:** DCR is a build tool, not a library. The GPL applies only to DCR's own source code. Projects built with DCR are not subject to DCR's license — their licensing is determined solely by their own code and dependencies.
|
> **Note:** DCR is a build tool, not a library. The GPL applies only to DCR's own source code. Projects built with DCR are not subject to DCR's license — their licensing is determined solely by their own code and dependencies.
|
||||||
|
|
||||||
## Vendored libraries
|
|
||||||
|
|
||||||
DCR statically links the following C libraries through its vendored Rust dependencies:
|
|
||||||
|
|
||||||
| Library | License | Bundled by |
|
|
||||||
| ------------------------------------------ | ------------------ | ----------------------------- |
|
|
||||||
| [libgit2](https://libgit2.org) | MIT OR Apache-2.0 | `git2` / `libgit2-sys` |
|
|
||||||
| [libssh2](https://libssh2.org) | MIT OR Apache-2.0 | `libgit2-sys` |
|
|
||||||
| [zlib](https://zlib.net) | MIT OR Apache-2.0 | `libgit2-sys` |
|
|
||||||
| [OpenSSL](https://openssl.org) | Apache-2.0 | `openssl-sys` / `openssl-src` |
|
|
||||||
| [ring](https://github.com/briansmith/ring) | Apache-2.0 AND ISC | `rustls` |
|
|
||||||
|
|
||||||
## Rust dependencies
|
## Rust dependencies
|
||||||
|
|
||||||
DCR is written in Rust. The following notable Rust crates are statically linked:
|
DCR is written in Rust. The following notable Rust crates are statically linked:
|
||||||
|
|
||||||
| Crate | License |
|
| Crate | License |
|
||||||
| --------------------------------------------- | ------------------------ |
|
| ------------------------------------------------------- | ----------------- |
|
||||||
| [`reqwest`](https://crates.io/crates/reqwest) | MIT OR Apache-2.0 |
|
| [`ureq`](https://crates.io/crates/ureq) | MIT OR Apache-2.0 |
|
||||||
| [`rustls`](https://crates.io/crates/rustls) | Apache-2.0 OR ISC OR MIT |
|
|
||||||
| [`serde`](https://crates.io/crates/serde) | MIT OR Apache-2.0 |
|
| [`serde`](https://crates.io/crates/serde) | MIT OR Apache-2.0 |
|
||||||
| [`toml`](https://crates.io/crates/toml) | MIT OR Apache-2.0 |
|
| [`toml`](https://crates.io/crates/toml) | MIT OR Apache-2.0 |
|
||||||
|
| [`toml_edit`](https://crates.io/crates/toml_edit) | MIT OR Apache-2.0 |
|
||||||
|
| [`serde_json`](https://crates.io/crates/serde_json) | MIT OR Apache-2.0 |
|
||||||
| [`sha2`](https://crates.io/crates/sha2) | MIT OR Apache-2.0 |
|
| [`sha2`](https://crates.io/crates/sha2) | MIT OR Apache-2.0 |
|
||||||
| [`git2`](https://crates.io/crates/git2) | MIT OR Apache-2.0 |
|
| [`glob`](https://crates.io/crates/glob) | MIT OR Apache-2.0 |
|
||||||
| [`openssl`](https://crates.io/crates/openssl) | Apache-2.0 |
|
| [`self-replace`](https://crates.io/crates/self-replace) | MIT OR Apache-2.0 |
|
||||||
| [`tokio`](https://crates.io/crates/tokio) | MIT |
|
|
||||||
| [`hyper`](https://crates.io/crates/hyper) | MIT |
|
|
||||||
| [`ctrlc`](https://crates.io/crates/ctrlc) | MIT OR Apache-2.0 |
|
| [`ctrlc`](https://crates.io/crates/ctrlc) | MIT OR Apache-2.0 |
|
||||||
|
|
||||||
Full dependency tree (143 packages) is available in [`Cargo.lock`](https://github.com/dexoron/dcr/blob/main/Cargo.lock). The overwhelming majority are dual-licensed under MIT OR Apache-2.0.
|
Full dependency tree is available in [`Cargo.lock`](https://github.com/dexoron/dcr/blob/main/Cargo.lock). The overwhelming majority are dual-licensed under MIT OR Apache-2.0.
|
||||||
|
|
||||||
## Additional credits
|
## Additional credits
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ type = "none"
|
|||||||
inherit = true
|
inherit = true
|
||||||
language = "c"
|
language = "c"
|
||||||
standard = "c11"
|
standard = "c11"
|
||||||
|
workspace_only = true
|
||||||
|
|
||||||
[workspace.lib-core]
|
[workspace.lib-core]
|
||||||
path = "lib-core"
|
path = "lib-core"
|
||||||
|
|||||||
@@ -38,10 +38,10 @@ 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 |
|
||||||
|
|
||||||
@@ -61,11 +61,11 @@ 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` |
|
||||||
@@ -80,13 +80,13 @@ author = "John Doe"
|
|||||||
| `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) |
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -41,24 +41,22 @@ DCR uses a package registry for dependency lookup by name.
|
|||||||
|
|
||||||
```toml
|
```toml
|
||||||
# ~/.dcr/config.toml
|
# ~/.dcr/config.toml
|
||||||
[[registry]]
|
[registry.default]
|
||||||
name = "default"
|
|
||||||
url = "https://index.dcr.pm"
|
url = "https://index.dcr.pm"
|
||||||
|
priority = 1
|
||||||
```
|
```
|
||||||
|
|
||||||
Registry priority: order in `config.toml`. The `DCR_INDEX_PATH` variable overrides the path to `index.json`.
|
Registry priority: order in `config.toml`. The `DCR_INDEX_PATH` variable overrides the path to `index.json`.
|
||||||
|
|
||||||
## Git dependencies
|
## Git dependencies
|
||||||
|
|
||||||
DCR clones git repositories via `git2`:
|
Git dependencies are parsed and recorded in `dcr.lock`. DCR supports specifying branch/tag/rev for git sources:
|
||||||
|
|
||||||
* `branch` — switch to a branch
|
* `branch` — switch to a branch
|
||||||
* `tag` — switch to a tag
|
* `tag` — switch to a tag
|
||||||
* `rev` — switch to a specific commit
|
* `rev` — switch to a specific commit
|
||||||
* `features` — feature flags (parsed, but does not affect build)
|
* `features` — feature flags (parsed, but does not affect build)
|
||||||
|
|
||||||
Cache path: `~/.dcr/git/\<hash>/`.
|
|
||||||
|
|
||||||
## Path dependencies
|
## Path dependencies
|
||||||
|
|
||||||
Local paths. DCR automatically discovers include and lib directories from the neighbor's `dcr.toml`.
|
Local paths. DCR automatically discovers include and lib directories from the neighbor's `dcr.toml`.
|
||||||
|
|||||||
@@ -65,3 +65,21 @@ standard = "c17"
|
|||||||
|
|
||||||
# member inherits language and standard
|
# member inherits language and standard
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Workspace-only root (no build of its own)
|
||||||
|
|
||||||
|
A workspace root can set `workspace_only = true` — it won't be built itself, and doesn't need `language` or `compiler`:
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[package]
|
||||||
|
name = "my-workspace"
|
||||||
|
version = "0.1.0"
|
||||||
|
|
||||||
|
[build]
|
||||||
|
workspace_only = true
|
||||||
|
kind = "bin"
|
||||||
|
|
||||||
|
[workspace]
|
||||||
|
lib-core = { path = "lib-core" }
|
||||||
|
app = { path = "app", deps = ["lib-core"] }
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user