-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.rs
27 lines (22 loc) · 876 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
fn main() {
let mut build = cc::Build::new();
// Match the override in magazine_impl.rs
#[cfg(feature = "test_only_small_constants")]
build.define("SLITTER__SMALL_CONSTANTS", "1");
for file in ["cache", "constants", "mag", "map", "span_metadata", "stack"].iter() {
println!("cargo:rerun-if-changed=c/{}.c", file);
println!("cargo:rerun-if-changed=c/{}.h", file);
build.file(format!("c/{}.c", file));
}
// This forces a cdylib to include the routines, but does not
// export the symbols...
println!("cargo:rustc-cdylib-link-arg=-uslitter_allocate");
println!("cargo:rustc-cdylib-link-arg=-uslitter_release");
build
.include("include")
.opt_level(2)
.flag_if_supported("-mcx16") // enable CMPXCHB16B
.flag("-W")
.flag("-Wall")
.compile("slitter_support")
}