-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This also adds rules to not unnecessarily run the build script (build.rs) if the input has not changed. This also moves the protobuf generation in its own library/subdirectory to avoid errors on docs.rs which mounts the src/ directory as read-only. Signed-off-by: Adrian Reber <areber@redhat.com>
- Loading branch information
1 parent
87a5e0b
commit 243d352
Showing
10 changed files
with
6,266 additions
and
7,004 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,7 @@ | ||
extern crate protobuf_codegen_pure; | ||
|
||
fn main() { | ||
protobuf_codegen_pure::Codegen::new() | ||
.out_dir("src/proto") | ||
.inputs(["proto/rpc.proto"]) | ||
.include("proto") | ||
.run() | ||
.expect("Codegen failed."); | ||
|
||
std::process::Command::new("gcc") | ||
.args(["test/piggie.c", "-o", "test/piggie"]) | ||
.status() | ||
.unwrap(); | ||
println!("cargo:rerun-if-changed=test/piggie.c"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[package] | ||
name = "rust-criu-protobuf" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
protobuf = "3.2.0" | ||
|
||
[build-dependencies] | ||
protobuf-codegen = "3.2.0" | ||
|
||
[lib] | ||
name = "rust_criu_protobuf" | ||
path = "src/mod.rs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
extern crate protobuf_codegen; | ||
|
||
fn main() { | ||
protobuf_codegen::Codegen::new() | ||
.includes(["proto"]) | ||
.input("proto/rpc.proto") | ||
.out_dir("src") | ||
.run_from_script(); | ||
|
||
println!("cargo:rerun-if-changed=proto/rpc.proto"); | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// @generated | ||
|
||
pub mod rpc; |
Oops, something went wrong.