Skip to content

Commit

Permalink
Document the feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Xion committed May 13, 2017
1 parent cb1e615 commit 8e6ffa5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/doc/build-script.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ All the lines printed to stdout by a build script are written to a file like `ta
cargo:rustc-link-lib=static=foo
cargo:rustc-link-search=native=/path/to/foo
cargo:rustc-cfg=foo
cargo:rustc-env=FOO=bar
# arbitrary user-defined metadata
cargo:root=/path/to/foo
cargo:libdir=/path/to/foo/lib
Expand All @@ -73,6 +74,12 @@ crate is built:
* `rustc-cfg=FEATURE` indicates that the specified feature will be passed as a
`--cfg` flag to the compiler. This is often useful for performing compile-time
detection of various features.
* `rustc-env=VAR=VALUE` indicates that the specified environment variable
will be added to the environment which the compiler is run within.
The value can be then retrieved by the `env!` macro in the compiled crate.
This is useful for embedding additional metadata in crate's code,
such as the hash of Git HEAD or the unique identifier of a continuous
integration server.
* `rerun-if-changed=PATH` is a path to a file or directory which indicates that
the build script should be re-run if it changes (detected by a more-recent
last-modified timestamp on the file). Normally build scripts are re-run if
Expand Down

0 comments on commit 8e6ffa5

Please sign in to comment.