aboutsummaryrefslogtreecommitdiff
path: root/build.rs
blob: 671cc39446d0a32010acc6ef49f0cb0600889657 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::process::Command;
fn main() {
    // Tell Cargo to rerun this build script if HEAD changes
    println!("cargo:rerun-if-changed=.git/HEAD");
    println!("cargo:rerun-if-changed=.git/refs/tags");

    let output = Command::new("git")
        .args(&["describe", "--tags", "--dirty", "--always"])
        .output()
        .unwrap();
    let git_version = String::from_utf8(output.stdout).unwrap();
    println!("cargo:rustc-env=GIT_VERSION={}", git_version.trim());
}