maplibre-rs/web/build.rs
Max Ammann 9496ef0e71
Fix regressions: Transferable flatbuffers (#221)
* Add geometry index again

* Switch to info level for run config

* Add setting for present_mode

* Remove unused file

* Adjust web to new message

* Update package-lock.json

* One of the first working versions with a large buffer

* Add features to fix builds

* Switch to flatbuffers for data passing

* Cleanup and move entries to wasm_entries

* Install protobuf and flatbuffers

* Fix windows CI

* Fix clippy errors and warnings for generated code
2022-12-11 21:11:49 +01:00

27 lines
664 B
Rust

use std::{env, fs, path::Path};
fn main() {
let out_dir = env::var("OUT_DIR").unwrap();
println!("cargo:rerun-if-changed=./flatbuffer");
let flatbuffer = fs::read_dir("./flatbuffer")
.unwrap()
.map(|entry| entry.unwrap().path())
.collect::<Vec<_>>();
flatc_rust::run(flatc_rust::Args {
inputs: &flatbuffer
.iter()
.map(|buf| buf.as_path())
.collect::<Vec<_>>(),
out_dir: Path::new(&out_dir),
extra: &[
"--include-prefix",
"platform::singlethreaded::transferables",
],
..Default::default()
})
.expect("flatc");
}