Leave lib.rs as container of tests
This commit is contained in:
parent
afdb7edd92
commit
d1d4d59321
3 changed files with 7 additions and 3 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -9,4 +9,3 @@ Cargo.lock
|
|||
# These are backup files generated by rustfmt
|
||||
**/*.rs.bk
|
||||
.idea/
|
||||
lvgl-sys/src/lib.rs
|
||||
|
|
|
@ -29,14 +29,14 @@ fn main() {
|
|||
.include(&lvgl_config_path)
|
||||
.compile("lvgl");
|
||||
|
||||
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
|
||||
let cc_args = ["-DLV_CONF_INCLUDE_SIMPLE=1", "-I", lvgl_config_path.to_str().unwrap()];
|
||||
bindgen::Builder::default()
|
||||
.header(src.parent().unwrap().join("lvgl.h").to_str().unwrap())
|
||||
.raw_line("#![allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]")
|
||||
.clang_args(&cc_args)
|
||||
.generate()
|
||||
.expect("Unable to generate bindings")
|
||||
.write_to_file(root_dir.join("lvgl-sys").join("src").join("lib.rs"))
|
||||
.write_to_file(out_path.join("bindings.rs"))
|
||||
.expect("Can't write bindings!");
|
||||
}
|
||||
|
||||
|
|
5
lvgl-sys/src/lib.rs
Normal file
5
lvgl-sys/src/lib.rs
Normal file
|
@ -0,0 +1,5 @@
|
|||
#![allow(non_snake_case)]
|
||||
#![allow(non_camel_case_types)]
|
||||
#![allow(non_upper_case_globals)]
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
|
Loading…
Reference in a new issue