build.rs 848 B

123456789101112131415161718192021222324252627
  1. //! Builds libthreema (d'oh!).
  2. use std::io::Result;
  3. #[cfg(feature = "uniffi")]
  4. use uniffi as _;
  5. fn main() -> Result<()> {
  6. // Compile protobuf
  7. println!("cargo:rerun-if-changed=../threema-protocols/src/");
  8. prost_build::Config::new()
  9. .message_attribute(".", "#[libthreema_macros::protobuf_annotations]")
  10. .enable_type_names()
  11. .compile_protos(
  12. &[
  13. "../threema-protocols/src/common.proto",
  14. "../threema-protocols/src/csp-e2e.proto",
  15. "../threema-protocols/src/md-d2d.proto",
  16. "../threema-protocols/src/md-d2d-sync.proto",
  17. "../threema-protocols/src/md-d2d-rendezvous.proto",
  18. "../threema-protocols/src/md-d2m.proto",
  19. ],
  20. &["../threema-protocols/src/"],
  21. )?;
  22. // Done
  23. Ok(())
  24. }