use std::path::Path;
pub(crate) fn compile_flat_buffer_self<P>(fbs_path: &[P])
where
P: AsRef<Path>,
{
let output_path = std::env::var("OUT_DIR").unwrap();
for path in fbs_path {
let path = path.as_ref();
let file_stem = path.file_stem().unwrap().to_str().unwrap();
let output_path = Path::new(&output_path).join("flatbuffers").join(file_stem);
use flatbuffers_build::BuilderOptions;
BuilderOptions::new_with_files([path])
.set_output_path(&output_path)
.compile()
.expect("flatbuffer compilation failed");
}
}