Skip to content

Commit

Permalink
build.rs: Add GITHUB_SHA detection
Browse files Browse the repository at this point in the history
  • Loading branch information
thirtythreeforty authored Dec 15, 2020
1 parent 5ccfd6a commit bdd270d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ fn build_ver() {
}

fn git_ver() -> Option<String> {
github_ver().or_else(git_cmd_ver)
}

fn git_cmd_ver() -> Option<String> {
let mut git_cmd = Command::new("git");
git_cmd.args(&["describe", "--tags"]);

Expand All @@ -32,6 +36,15 @@ fn git_ver() -> Option<String> {
}
}

fn github_ver() -> Option<String> {
if let Ok(sha1) = env::var("GITHUB_SHA") {
println!("cargo:rerun-if-env-changed=GITHUB_SHA");
Some(sha1)
} else {
None
}
}

#[cfg(windows)]
fn platform_cfg() {
let gstreamer_dir = env::var_os("GSTREAMER_1_0_ROOT_X86_64")
Expand Down

0 comments on commit bdd270d

Please sign in to comment.