Skip to content

Commit

Permalink
rephrase how cargo::metadata can be used
Browse files Browse the repository at this point in the history
  • Loading branch information
arctic-alpaca committed Nov 20, 2024
1 parent 66221ab commit 17ba198
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/doc/src/reference/build-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -432,11 +432,12 @@ key-value pairs. This metadata is set with the `cargo::metadata=KEY=VALUE`
instruction.

The metadata is passed to the build scripts of **dependent** packages. For
example, if the package `bar` depends on `foo`, then if `foo` generates
`key=value` as part of its build script metadata, then the build script of
`bar` will have the environment variables `DEP_FOO_KEY=value`. See the ["Using
another `sys` crate"][using-another-sys] for an example of how this can be
used.
example, if the package `foo` depends on `bar`, which links `baz`, then if
`bar` generates `key=value` as part of its build script metadata, then the
build script of `foo` will have the environment variables `DEP_BAZ_KEY=value`
(note that the value of the `links` key is used).
See the ["Using another `sys` crate"][using-another-sys] for an example of
how this can be used.

Note that metadata is only passed to immediate dependents, not transitive
dependents.
Expand Down

0 comments on commit 17ba198

Please sign in to comment.