Merge pull request #2924 from 4JX/master

hbb_common: Use OUT_DIR in build.rs
This commit is contained in:
RustDesk 2023-01-24 16:27:44 +08:00 committed by GitHub
commit a60f1823e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View File

@ -1,4 +1,3 @@
/target
**/*.rs.bk
Cargo.lock
src/protos/

View File

@ -1,8 +1,11 @@
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()
.pure()
.out_dir("src/protos")
.out_dir(out_dir)
.inputs(&["protos/rendezvous.proto", "protos/message.proto"])
.include("protos")
.customize(

View File

@ -0,0 +1 @@
include!(concat!(env!("OUT_DIR"), "/protos/mod.rs"));