summaryrefslogtreecommitdiff
path: root/build.rs
diff options
context:
space:
mode:
Diffstat (limited to 'build.rs')
-rw-r--r--build.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/build.rs b/build.rs
index 438ce37..5b868a4 100644
--- a/build.rs
+++ b/build.rs
@@ -1,4 +1,17 @@
+use std::process::Command;
+
fn main() {
+ let git_hash = Command::new("git")
+ .args(["describe", "--always", "--dirty", "--exclude='*'"])
+ .output()
+ .ok()
+ .filter(|output| output.status.success())
+ .and_then(|x| String::from_utf8(x.stdout).ok());
+
+ if let Some(hash) = git_hash.as_ref() {
+ println!("cargo:rustc-env=GIT_HASH={}", hash);
+ }
+
println!("cargo::rerun-if-changed=fonts/icons.toml");
iced_fontello::build("fonts/icons.toml").expect("Build icons font");
#[cfg(windows)]