forked from PoC-Consortium/engraver
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.rs
73 lines (53 loc) · 1.63 KB
/
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
extern crate cc;
fn main() {
let mut shared_config = cc::Build::new();
#[cfg(target_env = "msvc")]
shared_config
.flag("/O2")
.flag("/Oi")
.flag("/Ot")
.flag("/Oy")
.flag("/GT")
.flag("/GL");
#[cfg(not(target_env = "msvc"))]
shared_config.flag("-std=c99").flag("-mtune=native");
let mut config = shared_config.clone();
config
.file("src/c/sph_shabal.c")
.file("src/c/common.c")
.compile("shabal");
let mut config = shared_config.clone();
#[cfg(not(target_env = "msvc"))]
config.flag("-msse2");
config
.file("src/c/mshabal_128_sse2.c")
.file("src/c/noncegen_128_sse2.c")
.compile("shabal_sse2");
let mut config = shared_config.clone();
#[cfg(target_env = "msvc")]
config.flag("/arch:AVX2");
#[cfg(not(target_env = "msvc"))]
config.flag("-mavx2");
config
.file("src/c/mshabal_256_avx2.c")
.file("src/c/noncegen_256_avx2.c")
.compile("shabal_avx2");
let mut config = shared_config.clone();
#[cfg(target_env = "msvc")]
config.flag("/arch:AVX");
#[cfg(not(target_env = "msvc"))]
config.flag("-mavx");
config
.file("src/c/mshabal_128_avx.c")
.file("src/c/noncegen_128_avx.c")
.compile("shabal_avx");
let mut config = shared_config.clone();
#[cfg(target_env = "msvc")]
config.flag("/arch:AVX512");
#[cfg(not(target_env = "msvc"))]
config.flag("-mavx512f");
config
.file("src/c/mshabal_512_avx512f.c")
.file("src/c/noncegen_512_avx512f.c")
.compile("shabal_avx512");
}