-
Notifications
You must be signed in to change notification settings - Fork 48
/
build.rs
38 lines (38 loc) · 994 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
fn main() {
let mut versions = vec![];
if cfg!(feature = "llvm-9") {
versions.push(9);
}
if cfg!(feature = "llvm-10") {
versions.push(10);
}
if cfg!(feature = "llvm-11") {
versions.push(11);
}
if cfg!(feature = "llvm-12") {
versions.push(12);
}
if cfg!(feature = "llvm-13") {
versions.push(13);
}
if cfg!(feature = "llvm-14") {
versions.push(14);
}
if cfg!(feature = "llvm-15") {
versions.push(15);
}
if cfg!(feature = "llvm-16") {
versions.push(16);
}
if cfg!(feature = "llvm-17") {
versions.push(17);
}
if cfg!(feature = "llvm-18") {
versions.push(18);
}
match versions.len() {
0 => panic!("llvm-ir: Please select an LLVM version using a Cargo feature."),
1 => {},
_ => panic!("llvm-ir: Multiple LLVM versions selected. Please activate only one LLVM version feature. (Got {:?})", versions),
};
}