Skip to content

Commit

Permalink
add description about editing poac.toml directly to add dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
wx257osn2 committed Dec 23, 2024
1 parent 8400fcc commit 779e0c8
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ Poac uses a cache since we executed the command with no changes.
## Install dependencies
Like Cargo does, Poac installs dependencies at build time. Poac currently supports Git and system dependencies. You can use the `poac add` command to add dependencies to your project.
Like Cargo does, Poac installs dependencies at build time. Poac currently supports Git, path, and system dependencies. You can use two methods to add dependencies to your project: the `poac add` command, and editing `poac.toml` directly.
### `poac add`
The `poac add` command accepts the following arguments:
Expand All @@ -71,6 +73,26 @@ poac add "ToruNiina/toml11" --rev "846abd9a49082fe51440aa07005c360f13a67bbf"
If `tag`, `branch`, or `rev` is unspecified for git dependencies, Poac will use the latest revision of the default branch. System dependency names must be acceptable by `pkg-config`. The version requirement syntax is specified in [src/VersionReq.hpp](https://github.com/poac-dev/poac/blob/main/src/VersionReq.hpp).

### editing `poac.toml` directly

The syntax for `poac.toml` like below:

```toml
[dependencies]

# git dependency
"ToruNiina/toml11" = { git = "https://github.com/ToruNiina/toml11.git", rev = "846abd9a49082fe51440aa07005c360f13a67bbf" }

# path dependency
local_lib = { path = "../local_lib" }

# system dependency
fmt = { version = ">= 9", system = true }
```

If `tag`, `branch`, or `rev` is unspecified for git dependencies, Poac will use the latest revision of the default branch. System dependency names must be acceptable by `pkg-config`. The version requirement syntax is specified in [src/VersionReq.hpp](https://github.com/poac-dev/poac/blob/main/src/VersionReq.hpp).


After adding dependencies, executing the `build` command will install the package and its dependencies.

```console
Expand Down

0 comments on commit 779e0c8

Please sign in to comment.