-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.rs
31 lines (26 loc) · 1.23 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
fn main() {
let mut build = cxx_build::bridge("src/lib.rs");
let build = build
.include("src/libfacedetection")
.file("src/libfacedetection/facedetectcnn-data.cpp")
.file("src/libfacedetection/facedetectcnn-model.cpp")
.file("src/libfacedetection/facedetectcnn.cpp")
.file("src/bridge_wrapper.cpp")
.flag_if_supported("-std=c++11")
.flag("-O3");
// AVX (advanced vector extensions) support
#[cfg(target_feature = "avx2")]
let build = build.flag("-mavx2").define("_ENABLE_AVX2", None);
// Fused multiply-add instruction support.
#[cfg(target_feature = "fma")]
let build = build.flag("-mfma");
#[cfg(target_feature = "neon")]
let build = build.define("_ENABLE_NEON", None);
build.compile("rusty-yunet");
println!("cargo:rerun-if-changed=src/libfacedetection/facedetectcnn-data.cpp");
println!("cargo:rerun-if-changed=src/libfacedetection/facedetectcnn-model.cpp");
println!("cargo:rerun-if-changed=src/libfacedetection/facedetectcnn.cpp");
println!("cargo:rerun-if-changed=src/libfacedetection/facedetectcnn.h");
println!("cargo:rerun-if-changed=src/bridge_wrapper.h");
println!("cargo:rerun-if-changed=src/bridge_wrapper.cpp");
}