2023-09-05 10:56:07 +00:00
|
|
|
extern crate cc;
|
|
|
|
|
2024-01-09 22:39:29 +00:00
|
|
|
use std::env;
|
|
|
|
|
2023-09-05 10:56:07 +00:00
|
|
|
use cc::Build;
|
|
|
|
|
|
|
|
fn main() {
|
2024-01-09 22:39:29 +00:00
|
|
|
let mut cfg = Build::new();
|
|
|
|
cfg.include("c")
|
2023-09-05 10:56:07 +00:00
|
|
|
.file("c/aesb.c")
|
|
|
|
.file("c/blake256.c")
|
|
|
|
.file("c/groestl.c")
|
|
|
|
.file("c/hash-extra-blake.c")
|
|
|
|
.file("c/hash-extra-groestl.c")
|
|
|
|
.file("c/hash-extra-jh.c")
|
|
|
|
.file("c/hash-extra-skein.c")
|
|
|
|
.file("c/hash.c")
|
|
|
|
.file("c/jh.c")
|
|
|
|
.file("c/keccak.c")
|
|
|
|
.file("c/oaes_lib.c")
|
|
|
|
.file("c/skein.c")
|
|
|
|
.file("c/slow-hash.c")
|
|
|
|
.file("c/CryptonightR_JIT.c")
|
2023-10-29 00:02:12 +00:00
|
|
|
.flag("-O3")
|
2024-01-09 22:39:29 +00:00
|
|
|
.flag("-fexceptions");
|
|
|
|
|
|
|
|
let target = env::var("TARGET").unwrap();
|
|
|
|
if target.contains("x86_64") {
|
2024-01-10 01:49:35 +00:00
|
|
|
cfg.file("c/CryptonightR_template.S")
|
|
|
|
.flag("-maes")
|
|
|
|
.flag("-msse2");
|
2024-01-09 22:39:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
cfg.compile("cryptonight")
|
2023-09-05 10:56:07 +00:00
|
|
|
}
|