-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support
--verbose --version
/-vV
that provides more information: ``` build-date: 2023-06-27 build-target: aarch64-apple-darwin features: default,fancy_no_backtrace,git,rustls,static,trust_dns,zstd_thin commit-hash: 86731fcb8663f98e22a0ca7985f5bf407cc410f0 commit-date: 2023-06-28 rustc-version: 1.70.0 rustc-commit-hash: 90c541806f23a127002de5b4038be731ba1458ca rustc-llvm-version: 16.0 ``` Fixed #627 Signed-off-by: Jiahao XU <[email protected]>
- Loading branch information
Showing
6 changed files
with
75 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,31 @@ | ||
use std::{process::Command, thread}; | ||
|
||
fn main() { | ||
println!("cargo:rerun-if-changed=build.rs"); | ||
println!("cargo:rerun-if-changed=manifest.rc"); | ||
println!("cargo:rerun-if-changed=windows.manifest"); | ||
|
||
let handle = thread::spawn(|| { | ||
let git = Command::new("git").arg("--version").spawn(); | ||
|
||
let mut builder = vergen::EmitBuilder::builder(); | ||
builder.all_build().all_cargo().all_rustc(); | ||
|
||
let has_git = git | ||
.and_then(|mut git| git.wait()) | ||
.map(|status| status.success()) | ||
.unwrap_or(false); | ||
|
||
if has_git { | ||
builder.all_git(); | ||
} else { | ||
builder.disable_git(); | ||
} | ||
|
||
builder.emit().unwrap(); | ||
}); | ||
|
||
embed_resource::compile("manifest.rc", embed_resource::NONE); | ||
|
||
handle.join().unwrap(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters