2016-01-21 01:03:24 +00:00
|
|
|
extern crate ctest;
|
|
|
|
|
|
|
|
use std::env;
|
|
|
|
use std::path::PathBuf;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let root = PathBuf::from(env::var_os("DEP_JEMALLOC_ROOT").unwrap());
|
|
|
|
|
|
|
|
let mut cfg = ctest::TestGenerator::new();
|
|
|
|
cfg.header("jemalloc/jemalloc.h")
|
2017-05-30 04:58:12 +00:00
|
|
|
.include(root.join("include"))
|
|
|
|
.fn_cname(|rust, link_name| link_name.unwrap_or(rust).to_string());
|
|
|
|
|
|
|
|
if cfg!(target_os = "linux") {
|
|
|
|
cfg.skip_fn(|f| f == "malloc_usable_size");
|
|
|
|
}
|
|
|
|
|
2016-01-21 01:03:24 +00:00
|
|
|
cfg.generate("../jemalloc-sys/src/lib.rs", "all.rs");
|
|
|
|
}
|