diff --git a/common/Cargo.toml b/common/Cargo.toml index 9438985..dcd3758 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -10,3 +10,7 @@ prost = "0.12" [build-dependencies] tonic-build = "0.11" + +[lib] +name = "navka_common" +path = "src/lib.rs" diff --git a/common/build.rs b/common/build.rs index b713560..33d28f6 100644 --- a/common/build.rs +++ b/common/build.rs @@ -1,8 +1,3 @@ fn main() { - tonic_build::configure() - .build_client(true) - .build_server(true) - .out_dir("src/") - .compile(&["proto/navka.proto"], &["proto"]) - .unwrap(); + tonic_build::compile_protos("proto/navka.proto").unwrap(); } diff --git a/common/src/lib.rs b/common/src/lib.rs new file mode 100644 index 0000000..d024a88 --- /dev/null +++ b/common/src/lib.rs @@ -0,0 +1,4 @@ +// Re-export the code generated by build.rs (navka.rs, relay.rs, etc.) +pub mod navka { + include!(concat!(env!("OUT_DIR"), "/navka.rs")); +}