From 714b5f8fa24bbd9d5c9b08a2d2a344783ac67f71 Mon Sep 17 00:00:00 2001 From: Kent Ross Date: Fri, 15 Mar 2024 20:58:19 -0700 Subject: [PATCH] option to use already-existing generated files for flatbuffers and capnp (#63) --- Cargo.toml | 5 +++++ build.rs | 2 ++ 2 files changed, 7 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index d410f3f..eac366d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/build.rs b/build.rs index 240463d..390723f 100644 --- a/build.rs +++ b/build.rs @@ -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();