forked from flier/rust-atomic-traits
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.rs
27 lines (20 loc) · 826 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
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
}
}