Commit b7c6b197 authored by Luca Barbato's avatar Luca Barbato Committed by Thomas Daede
Browse files

Update to follow the suggested workflow for generated code

parent f8a52d7a
......@@ -3,4 +3,3 @@ target
Cargo.lock
*.y4m
*.ivf
aom.rs
......@@ -25,7 +25,7 @@ backtrace = "0.3"
cc = "1"
cmake = "0.1.29"
pkg-config = "0.3.9"
bindgen = { version = "0.33", optional = true }
bindgen = { version = "0.37", optional = true }
[dev-dependencies]
bencher = "0.1.5"
......
......@@ -39,13 +39,11 @@ fn main() {
#[cfg(feature = "decode_test")] {
use std::io::Write;
let out_dir = env::var("OUT_DIR").unwrap();
let headers = _libs.include_paths.clone();
let mut builder = bindgen::builder()
.raw_line("#![allow(dead_code)]")
.raw_line("#![allow(non_camel_case_types)]")
.raw_line("#![allow(non_snake_case)]")
.raw_line("#![allow(non_upper_case_globals)]")
.blacklist_type("max_align_t")
.rustfmt_bindings(false)
.header("data/aom.h");
......@@ -62,7 +60,9 @@ fn main() {
.replace("/**", "/*")
.replace("/*!", "/*");
let mut file = fs::File::create("src/aom.rs").unwrap();
let dest_path = Path::new(&out_dir).join("aom.rs");
let mut file = fs::File::create(dest_path).unwrap();
let _ = file.write(s.as_bytes());
}
......
#![allow(dead_code)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
include!(concat!(env!("OUT_DIR"), "/aom.rs"));
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment