forked from rustyhorde/vergen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.rs
48 lines (39 loc) · 959 Bytes
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
use chrono::Utc;
pub fn main() {
println!("cargo:rerun-if-changed=build.rs");
// These are here so some doc tests work
let now = Utc::now();
println!(
"cargo:rustc-env=VERGEN_BUILD_TIMESTAMP={}",
now.to_rfc3339()
);
println!("cargo:rustc-env=VERGEN_GIT_SEMVER=v3.2.0-86-g95fc0f5");
nightly_lints();
beta_lints();
stable_lints();
msrv_lints();
}
#[rustversion::nightly]
fn nightly_lints() {
println!("cargo:rustc-cfg=nightly_lints");
}
#[rustversion::not(nightly)]
fn nightly_lints() {}
#[rustversion::beta]
fn beta_lints() {
println!("cargo:rustc-cfg=beta_lints");
}
#[rustversion::not(beta)]
fn beta_lints() {}
#[rustversion::stable]
fn stable_lints() {
println!("cargo:rustc-cfg=stable_lints");
}
#[rustversion::not(stable)]
fn stable_lints() {}
#[rustversion::before(1.58)]
fn msrv_lints() {}
#[rustversion::since(1.58)]
fn msrv_lints() {
println!("cargo:rustc-cfg=msrv");
}