use std::env;
use std::fs;
use std::path::PathBuf;
fn main() {
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
let wrapper = out_dir.join("zbq_impl.c");
fs::write(
&wrapper,
concat!(
"#define _GNU_SOURCE\n",
"#define ZBQ_IMPLEMENTATION\n",
"#include <zbq.h>\n",
),
)
.expect("failed to write zbq_impl.c");
let manifest_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
println!(
"cargo:rerun-if-changed={}",
manifest_dir.join("zbq.h").display()
);
cc::Build::new()
.file(&wrapper)
.include(&manifest_dir)
.opt_level(3)
.compile("zbq_impl");
}