stream world data from pxl8d to pxl8
This commit is contained in:
parent
39ee0fefb7
commit
a71a9840b2
55 changed files with 5290 additions and 2131 deletions
32
pxl8d/build.rs
Normal file
32
pxl8d/build.rs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
use std::env;
|
||||
use std::path::PathBuf;
|
||||
|
||||
fn main() {
|
||||
let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
|
||||
let pxl8_src = PathBuf::from(&manifest_dir).join("../src");
|
||||
|
||||
println!("cargo:rerun-if-changed=../src/core/pxl8_log.c");
|
||||
println!("cargo:rerun-if-changed=../src/core/pxl8_log.h");
|
||||
println!("cargo:rerun-if-changed=../src/core/pxl8_types.h");
|
||||
println!("cargo:rerun-if-changed=../src/net/pxl8_protocol.h");
|
||||
|
||||
cc::Build::new()
|
||||
.file(pxl8_src.join("core/pxl8_log.c"))
|
||||
.include(pxl8_src.join("core"))
|
||||
.define("PXL8_SERVER", None)
|
||||
.compile("pxl8_log");
|
||||
|
||||
let bindings = bindgen::Builder::default()
|
||||
.header(pxl8_src.join("core/pxl8_log.h").to_str().unwrap())
|
||||
.header(pxl8_src.join("net/pxl8_protocol.h").to_str().unwrap())
|
||||
.clang_arg(format!("-I{}", pxl8_src.join("core").display()))
|
||||
.use_core()
|
||||
.rustified_enum(".*")
|
||||
.generate()
|
||||
.expect("Unable to generate bindings");
|
||||
|
||||
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
|
||||
bindings
|
||||
.write_to_file(out_path.join("protocol.rs"))
|
||||
.expect("Couldn't write bindings");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue