-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathbuild.rs
More file actions
47 lines (35 loc) · 1.53 KB
/
build.rs
File metadata and controls
47 lines (35 loc) · 1.53 KB
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
extern crate rustc_version;
use rustc_version::{version_meta, Version};
fn main() {
let version = version_meta().unwrap();
if version.semver >= Version::new(1, 10, 0) {
println!("cargo:rustc-cfg=feature=\"since_1_10_0\""); // extended_compare_and_swap
}
if version.semver >= Version::new(1, 15, 0) {
println!("cargo:rustc-cfg=feature=\"since_1_15_0\""); // atomic_access
}
if version.semver >= Version::new(1, 27, 0) {
println!("cargo:rustc-cfg=feature=\"since_1_27_0\""); // atomic_nand
}
if version.semver >= Version::new(1, 34, 0) {
println!("cargo:rustc-cfg=feature=\"since_1_34_0\""); // integer_atomics
}
if version.semver >= Version::new(1, 45, 0) {
println!("cargo:rustc-cfg=feature=\"since_1_45_0\""); // update, min, max
}
if version.semver >= Version::new(1, 50, 0) {
println!("cargo:rustc-cfg=feature=\"since_1_50_0\""); // extended_compare_and_swap deprecated
}
if version.semver >= Version::new(1, 53, 0) {
println!("cargo:rustc-cfg=feature=\"since_1_53_0\""); // fetch_update for AtomicBool and AtomicPtr
}
if version.semver >= Version::new(1, 60, 0) {
println!("cargo:rustc-cfg=feature=\"since_1_60_0\""); // target_has_atomic
}
if version.semver >= Version::new(1, 70, 0) {
println!("cargo:rustc-cfg=feature=\"since_1_70_0\""); // atomic_as_ptr
}
if version.semver >= Version::new(1, 75, 0) {
println!("cargo:rustc-cfg=feature=\"since_1_75_0\""); // atomic_from_ptr
}
}