Skip to content

Commit

Permalink
Cleanup output if version mismatch.
Browse files Browse the repository at this point in the history
  • Loading branch information
frewsxcv committed Apr 26, 2018
1 parent c3c2919 commit 05fd160
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::env;
use std::process::Command;
use std::process::{self, Command};

const VERSION: &'static str = env!("CARGO_PKG_VERSION");

Expand All @@ -21,9 +21,11 @@ fn main() {

// check that "cargo hfuzz" command is at the same version as this file
let honggfuzz_build_version = env::var("CARGO_HONGGFUZZ_BUILD_VERSION").unwrap_or("unknown".to_string());
assert!(VERSION == honggfuzz_build_version,
"hongfuzz dependency ({}) and build command ({}) versions do not match",
VERSION, honggfuzz_build_version);
if VERSION != honggfuzz_build_version {
eprintln!("hongfuzz dependency ({}) and build command ({}) versions do not match",
VERSION, honggfuzz_build_version);
process::exit(1);
}

let out_dir = env::var("OUT_DIR").unwrap(); // from cargo
let crate_root = env::var("CRATE_ROOT").unwrap(); //from honggfuzz
Expand Down

0 comments on commit 05fd160

Please sign in to comment.