diff --git a/crates/rtss_dto/build.rs b/crates/rtss_dto/build.rs index 15e100b..637b086 100644 --- a/crates/rtss_dto/build.rs +++ b/crates/rtss_dto/build.rs @@ -2,6 +2,15 @@ use std::process::Command; use prost_build::Config; fn main() { + // 获取构建的profile + let profile = std::env::var("PROFILE").unwrap(); + println!("profile: {}", profile); + + // 如果是release模式,不重新生成 + if profile == "release" { + return; + } + // println!("cargo:rerun-if-changed=build.rs"); #[cfg(target_os = "windows")] {