Browse Source

no gen_version if debug

rustdesk 3 years ago
parent
commit
ee794d2e40
1 changed files with 4 additions and 0 deletions
  1. 4 0
      libs/hbb_common/src/lib.rs

+ 4 - 0
libs/hbb_common/src/lib.rs

@@ -180,6 +180,10 @@ pub fn get_version_from_url(url: &str) -> String {
180
 }
180
 }
181
 
181
 
182
 pub fn gen_version() {
182
 pub fn gen_version() {
183
+    if Ok("release".to_owned()) != std::env::var("PROFILE") {
184
+        return;
185
+    }
186
+    println!("cargo:rerun-if-changed=Cargo.toml");
183
     use std::io::prelude::*;
187
     use std::io::prelude::*;
184
     let mut file = File::create("./src/version.rs").unwrap();
188
     let mut file = File::create("./src/version.rs").unwrap();
185
     for line in read_lines("Cargo.toml").unwrap().flatten() {
189
     for line in read_lines("Cargo.toml").unwrap().flatten() {