Refactor the build script
This commit is contained in:
parent
9821a9888e
commit
d9eecf1f5f
1 changed files with 7 additions and 3 deletions
10
build.rs
10
build.rs
|
@ -1,9 +1,13 @@
|
|||
use std::env;
|
||||
|
||||
const DEFAULT_VARLIBDIR: &str = "/var/lib/";
|
||||
const VARLIBDIR_NAME: &str = "VARLIBDIR";
|
||||
const VARLIBDIR_VALUE_DEFAULT: &str = "/var/lib/";
|
||||
|
||||
fn main() {
|
||||
if let Err(_) = env::var("VARLIBDIR") {
|
||||
println!("cargo:rustc-env={}={}", "VARLIBDIR", DEFAULT_VARLIBDIR);
|
||||
if env::var(VARLIBDIR_NAME).is_err() {
|
||||
println!(
|
||||
"cargo:rustc-env={}={}",
|
||||
VARLIBDIR_NAME, VARLIBDIR_VALUE_DEFAULT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue