qoi/qoi-bench/build.rs

19 lines
468 B
Rust
Raw Normal View History

2021-12-02 16:02:30 +00:00
use std::env;
use std::fs;
use std::path::PathBuf;
fn main() {
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
let out_src = out_dir.join("qoi.c");
fs::write(&out_src, "#include \"qoi.h\"\n").unwrap();
cc::Build::new()
.file(&out_src)
.include("../ext/qoi")
.define("QOI_NO_STDIO", None)
.define("QOI_IMPLEMENTATION", None)
.flag("-Wno-unsequenced")
.opt_level(3)
.compile("qoi");
}