#build #build-script #build-time #tiny #values #cargo #setting-getting

build chksum-build

Tiny library for setting/getting build-time values for your crate

1 unstable release

0.0.3 Jan 2, 2023
0.0.2 Dec 29, 2022
0.0.1 Dec 14, 2022
0.0.0 Nov 27, 2022

#409 in Build Utils

Download history 2/week @ 2023-12-18 7/week @ 2024-02-19 14/week @ 2024-02-26 1/week @ 2024-03-04 9/week @ 2024-03-11 3/week @ 2024-03-18 74/week @ 2024-04-01

87 downloads per month

MIT license

44KB
903 lines

chksum-build

Build Coverage crates.io docs.rs MSRV unsafe forbidden LICENSE

Tiny library for setting/getting build-time values for your crate.

Features

  • Pure Rust,
  • No unsafe code,
  • As small as it possible,
  • Configurable via Cargo features.

Setup

Create build.rs

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()
}

Update Cargo.toml

Modify package section

[package]
# ...
build = "build.rs"

Modify build-dependencies section

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

Modify dependencies section

As in the example above you can add entry manually.

[dependencies]
# ...
chksum-build = "0.0.3"

Or by using subcommand.

cargo add chksum-build

Usage

use chksum_build::build_info;

let build_info = build_info!();

More usage examples are available in the documentation at docs.rs.

Alternatives

License

MIT

Dependencies

~2.2–9.5MB
~61K SLoC