Support for vergen information when vendoring
This commit is contained in:
parent
ff1d216207
commit
d1a6144926
3 changed files with 18 additions and 14 deletions
14
build.rs
14
build.rs
|
|
@ -2,10 +2,14 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
// Rebuild if i18n files change
|
||||
println!("cargo:rerun-if-changed=i18n");
|
||||
|
||||
vergen::EmitBuilder::builder()
|
||||
.fail_on_error()
|
||||
.git_commit_date()
|
||||
.git_sha(true)
|
||||
.emit()?;
|
||||
// Emit version information (if not cached by just vendor)
|
||||
let mut vergen = vergen::EmitBuilder::builder();
|
||||
if std::env::var_os("VERGEN_GIT_COMMIT_DATE").is_none() {
|
||||
vergen.git_commit_date();
|
||||
}
|
||||
if std::env::var_os("VERGEN_GIT_SHA").is_none() {
|
||||
vergen.git_sha(true);
|
||||
}
|
||||
vergen.fail_on_error().emit()?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue