build.rs 624 B

12345678910111213141516171819
  1. use std::io::Result;
  2. /// Automatically runs during cargo build.
  3. /// Proto files for Lazer are defined in the lazer sdk folder in the proto/ subdirectory.
  4. /// Both JS and Rust SDKs read the proto files for generating types.
  5. fn main() -> Result<()> {
  6. // Tell cargo to recompile if any .proto files change
  7. println!("cargo:rerun-if-changed=../proto/");
  8. protobuf_codegen::Codegen::new()
  9. .pure()
  10. .include("../proto")
  11. .input("../proto/publisher_update.proto")
  12. .input("../proto/pyth_lazer_transaction.proto")
  13. .cargo_out_dir("protobuf")
  14. .run_from_script();
  15. Ok(())
  16. }