use std::env;
use std::fs::File;
use std::io::{Read, Write};
use std::path::Path;
fn main() {
println!("cargo:rerun-if-changed=build.rs");
if env::var("CARGO_FEATURE_BUILD_SEPARATOR").is_ok() {
let out_dir = env::var("OUT_DIR").unwrap();
let dest_path = Path::new(&out_dir).join("build_separator.bin");
let mut f = File::create(&dest_path).unwrap();
let mut buf = [0u8; 64];
let mut urandom = File::open("/dev/urandom").expect("build.rs: /dev/urandom unavailable — cannot generate BUILD_SEPARATOR");
urandom.read_exact(&mut buf).expect("build.rs: failed to read 64 bytes from /dev/urandom");
f.write_all(&buf).unwrap();
}
}