5 unstable releases
0.3.1 | Aug 26, 2024 |
---|---|
0.3.0 | Aug 26, 2024 |
0.2.0 | Sep 2, 2022 |
0.1.2 | Jul 1, 2022 |
0.1.1 | May 31, 2022 |
#874 in Development tools
131 downloads per month
Used in mcai_worker_sdk
4KB
MCAI Build
This crate allows to export information form Cargo.toml
at compile time.
lib.rs
:
MCAI Build
This crates allows to export Cargo.toml
variables at compile time, so that they can be used at execution time.
Usage
- Add
mcai_build
in thebuild-dependencies
of your package. - Add
serde_json
in thedependencies
of your package. - Add a
build.rs
file next to yourCargo.toml
that contains the following code:
fn main() {
mcai_build::build_mcai_info()
}
- You can now use the exported variables in your code:
use cargo_toml::Package;
let package: Package = include!(concat!(env!("OUT_DIR"), "/mcai_build.rs"));
Dependencies
~4.5MB
~40K SLoC