2
0
mirror of https://github.com/qarmin/czkawka synced 2024-11-16 06:12:48 +00:00
czkawka/czkawka_core/build.rs
2023-12-11 19:12:26 +01:00

19 lines
616 B
Rust

fn main() {
let rust_version = match rustc_version::version_meta() {
Ok(meta) => {
let rust_v = meta.semver.to_string();
let rust_date = meta.commit_date.unwrap_or_default();
format!("{rust_v} ({rust_date})")
}
Err(_) => "<unknown>".to_string(),
};
println!("cargo:rustc-env=RUST_VERSION_INTERNAL={rust_version}");
// Find if app is build with cranelift
if let Ok(codegen) = std::env::var("CARGO_PROFILE_RELEASE_CODEGEN_UNITS") {
if codegen == "1" {
println!("cargo:rustc-env=USING_CRANELIFT=1");
}
}
}