A Rust library for reading the OpenStreetMap PBF file format (*.osm.pbf).

build_proto.rs 542B

12345678910111213141516171819202122
  1. //! To regenerate *.rs files in `src/proto/` rename this file to `build.rs`
  2. //! and add this to `Cargo.toml`:
  3. //! ```
  4. //! [build-dependencies]
  5. //! protoc-rust = "2.0"
  6. //! ```
  7. extern crate protoc_rust;
  8. fn main() {
  9. let proto_files = ["src/proto/fileformat.proto", "src/proto/osmformat.proto"];
  10. for path in &proto_files {
  11. println!("cargo:rerun-if-changed={}", path);
  12. }
  13. protoc_rust::Codegen::new()
  14. .out_dir("src/proto")
  15. .inputs(&proto_files)
  16. .run()
  17. .expect("Running protoc failed.");
  18. }