#env-var #build-environment #cargo #process #extract #information #target

build-env

Extract information about the build process from the environment

6 releases (3 breaking)

Uses old Rust 2015

0.3.1 May 9, 2021
0.3.0 Sep 8, 2020
0.2.0 Aug 21, 2020
0.1.0 Aug 21, 2020
0.0.2 Jul 29, 2016

#812 in Development tools

Download history 1907/week @ 2023-11-30 2189/week @ 2023-12-07 2456/week @ 2023-12-14 977/week @ 2023-12-21 1056/week @ 2023-12-28 1880/week @ 2024-01-04 2033/week @ 2024-01-11 2210/week @ 2024-01-18 2388/week @ 2024-01-25 2390/week @ 2024-02-01 2865/week @ 2024-02-08 2982/week @ 2024-02-15 2934/week @ 2024-02-22 2970/week @ 2024-02-29 2870/week @ 2024-03-07 2744/week @ 2024-03-14

12,041 downloads per month
Used in 13 crates (2 directly)

Apache-2.0 OR MIT

13KB
237 lines

build-env

Get information about the build from environment variables

let mut be = build_env::BuildEnv::from_env().unwrap();
let _: Option<OsString> = be.var_os("CC");

Prints all used env vars in cargo dependency format:

cargo:rerun-if-env-changed=CC_target-triple
cargo:rerun-if-env-changed=CC_target_triple
cargo:rerun-if-env-changed=HOST_CC
cargo:rerun-if-env-changed=CC

Documentation Crates.io Travis

No runtime deps