Skip to content

Commit

Permalink
option to use already-existing generated files for flatbuffers and capnp
Browse files Browse the repository at this point in the history
  • Loading branch information
mumbleskates committed Feb 6, 2024
1 parent 2a8527e commit 6e3e0eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ savefile = ["dep:savefile", "savefile-derive"]

scale = ["parity-scale-codec", "parity-scale-codec-derive"]

# Enable these to use the already-committed generated files for capnp and
# flatbuffers rather than regenerating them.
use-committed-capnp = []
use-committed-flatbuffers = []

[dev-dependencies]
rand_pcg = "0.3.1"

Expand Down
2 changes: 2 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ fn main() {
const DATASETS: &[&str] = &["log", "mesh", "minecraft_savedata", "mk48"];
for &name in DATASETS.iter() {
// bebop_compile_dataset(name);
#[cfg(all(feature = "capnp", not(feature = "use-committed-capnp")))]
capnpc_compile_dataset(name).unwrap();
#[cfg(all(feature = "flatbuffers", not(feature = "use-committed-flatbuffers")))]
flatc_compile_dataset(name).unwrap();
#[cfg(feature = "prost-build")]
prost_compile_dataset(name).unwrap();
Expand Down

0 comments on commit 6e3e0eb

Please sign in to comment.