-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.rs
More file actions
61 lines (58 loc) · 2.66 KB
/
build.rs
File metadata and controls
61 lines (58 loc) · 2.66 KB
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
use std::{env, path};
pub fn main() {
println!("cargo:rerun-if-changed=src/fdlibm");
println!("cargo:rerun-if-changed=build.rs");
bindgen::Builder::default()
.header("src/fdlibm/fdlibm.h")
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.use_core()
.no_convert_floats()
.layout_tests(false)
.generate()
.expect("Unable to generate bindings")
.write_to_file("src/strict_math.rs")
.expect("Couldn't write bindings!");
let mut cfg = cc::Build::new();
if env::var("CARGO_CFG_TARGET_ENDIAN").unwrap() == "little" {
cfg.define("__LITTLE_ENDIAN", None);
}
cfg.include("src/fdlibm")
.file(path::Path::new("src/fdlibm/w_acos.c"))
.file(path::Path::new("src/fdlibm/e_acos.c"))
.file(path::Path::new("src/fdlibm/e_sqrt.c"))
.file(path::Path::new("src/fdlibm/w_sqrt.c"))
.file(path::Path::new("src/fdlibm/w_asin.c"))
.file(path::Path::new("src/fdlibm/e_asin.c"))
.file(path::Path::new("src/fdlibm/s_fabs.c"))
.file(path::Path::new("src/fdlibm/e_atan2.c"))
.file(path::Path::new("src/fdlibm/w_atan2.c"))
.file(path::Path::new("src/fdlibm/s_expm1.c"))
.file(path::Path::new("src/fdlibm/e_hypot.c"))
.file(path::Path::new("src/fdlibm/w_hypot.c"))
.file(path::Path::new("src/fdlibm/e_sinh.c"))
.file(path::Path::new("src/fdlibm/w_sinh.c"))
.file(path::Path::new("src/fdlibm/e_exp.c"))
.file(path::Path::new("src/fdlibm/w_exp.c"))
.file(path::Path::new("src/fdlibm/s_tanh.c"))
.file(path::Path::new("src/fdlibm/s_cbrt.c"))
.file(path::Path::new("src/fdlibm/e_cosh.c"))
.file(path::Path::new("src/fdlibm/w_cosh.c"))
.file(path::Path::new("src/fdlibm/s_log1p.c"))
.file(path::Path::new("src/fdlibm/e_log.c"))
.file(path::Path::new("src/fdlibm/w_log.c"))
.file(path::Path::new("src/fdlibm/s_atan.c"))
.file(path::Path::new("src/fdlibm/k_tan.c"))
.file(path::Path::new("src/fdlibm/s_tan.c"))
.file(path::Path::new("src/fdlibm/e_rem_pio2.c"))
.file(path::Path::new("src/fdlibm/k_rem_pio2.c"))
.file(path::Path::new("src/fdlibm/s_floor.c"))
.file(path::Path::new("src/fdlibm/s_cos.c"))
.file(path::Path::new("src/fdlibm/k_cos.c"))
.file(path::Path::new("src/fdlibm/k_sin.c"))
.file(path::Path::new("src/fdlibm/s_sin.c"))
.file(path::Path::new("src/fdlibm/e_log10.c"))
.file(path::Path::new("src/fdlibm/w_log10.c"))
.file(path::Path::new("src/fdlibm/e_pow.c"))
.file(path::Path::new("src/fdlibm/w_pow.c"))
.compile("fdlibm");
}