code rewritted to modules; add local/server flags to build
This commit is contained in:
17
build.rs
Normal file
17
build.rs
Normal file
@ -0,0 +1,17 @@
|
||||
fn main() {
|
||||
println!("cargo:rerun-if-env-changed=LOCAL");
|
||||
println!("cargo:rustc-check-cfg=cfg(local)");
|
||||
|
||||
let local_env = std::env::var("LOCAL")
|
||||
.map(|v| {
|
||||
let v = v.trim().to_ascii_lowercase();
|
||||
matches!(v.as_str(), "true" | "1" | "yes" | "on")
|
||||
})
|
||||
.unwrap_or(false);
|
||||
|
||||
let local_feature = std::env::var("CARGO_FEATURE_LOCAL").is_ok();
|
||||
|
||||
if local_env || local_feature {
|
||||
println!("cargo:rustc-cfg=local");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user