Use OUT_DIR in build.rs
This commit is contained in:
parent
efa7b52f49
commit
f591f5686c
1
libs/hbb_common/.gitignore
vendored
1
libs/hbb_common/.gitignore
vendored
@ -1,4 +1,3 @@
|
|||||||
/target
|
/target
|
||||||
**/*.rs.bk
|
**/*.rs.bk
|
||||||
Cargo.lock
|
Cargo.lock
|
||||||
src/protos/
|
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
fn main() {
|
fn main() {
|
||||||
std::fs::create_dir_all("src/protos").unwrap();
|
let out_dir = format!("{}/protos", std::env::var("OUT_DIR").unwrap());
|
||||||
|
|
||||||
|
std::fs::create_dir_all(&out_dir).unwrap();
|
||||||
|
|
||||||
protobuf_codegen::Codegen::new()
|
protobuf_codegen::Codegen::new()
|
||||||
.pure()
|
.pure()
|
||||||
.out_dir("src/protos")
|
.out_dir(out_dir)
|
||||||
.inputs(&["protos/rendezvous.proto", "protos/message.proto"])
|
.inputs(&["protos/rendezvous.proto", "protos/message.proto"])
|
||||||
.include("protos")
|
.include("protos")
|
||||||
.customize(
|
.customize(
|
||||||
|
1
libs/hbb_common/src/protos/mod.rs
Normal file
1
libs/hbb_common/src/protos/mod.rs
Normal file
@ -0,0 +1 @@
|
|||||||
|
include!(concat!(env!("OUT_DIR"), "/protos/mod.rs"));
|
Loading…
x
Reference in New Issue
Block a user