aboutsummaryrefslogtreecommitdiff
path: root/build.rs
diff options
context:
space:
mode:
Diffstat (limited to 'build.rs')
-rw-r--r--build.rs30
1 files changed, 2 insertions, 28 deletions
diff --git a/build.rs b/build.rs
index a6f53ae..ce2f258 100644
--- a/build.rs
+++ b/build.rs
@@ -16,32 +16,6 @@
// Copyright (C) 2022-2022 Fuwn <[email protected]>
// SPDX-License-Identifier: GPL-3.0-only
-use std::env::var;
-
-/// <https://github.com/denoland/deno/blob/main/cli/build.rs#L265:L285>
-fn git_commit_hash() -> String {
- if let Ok(output) = std::process::Command::new("git")
- .arg("rev-list")
- .arg("-1")
- .arg("HEAD")
- .output()
- {
- if output.status.success() {
- std::str::from_utf8(&output.stdout[..40])
- .unwrap()
- .to_string()
- } else {
- "UNKNOWN".to_string()
- }
- } else {
- "UNKNOWN".to_string()
- }
-}
-
-fn main() {
- println!("cargo:rerun-if-changed=build.rs");
- println!("cargo:rustc-env=GIT_COMMIT_HASH={}", git_commit_hash());
- println!("cargo:rerun-if-env-changed=GIT_COMMIT_HASH");
- println!("cargo:rustc-env=TARGET={}", var("TARGET").unwrap());
- println!("cargo:rustc-env=PROFILE={}", var("PROFILE").unwrap());
+fn main() -> anyhow::Result<()> {
+ vergen::vergen(vergen::Config::default())
}