Tiny library for setting/getting build-time values for your crate.
- Pure Rust,
- No unsafe code,
- As small as it possible,
- Configurable via Cargo features.
Create new file build.rs
at the top level of your crate (next to Cargo.toml
).
use chksum_build::{BuildScript, Result};
fn main() -> Result<()> {
BuildScript::default().setup()
}
[package]
# ...
build = "build.rs"
You can update Cargo.toml
on your own.
[build-dependencies]
# ...
chksum-build = "0.0.3"
Or use cargo add
subcommand.
cargo add --build chksum-build
As in the example above you can add entry manually.
[dependencies]
# ...
chksum-build = "0.0.3"
Or by using subcommand.
cargo add chksum-build
use chksum_build::build_info;
let build_info = build_info!();
More usage examples are available in the documentation at docs.rs.
MIT