#[cfg(any(not(feature = "install_dummy_dll"), not(target_os = "windows")))]
fn main() {
println!("cargo:rerun-if-changed=build.rs");
}
#[cfg(all(feature = "install_dummy_dll", target_os = "windows"))]
fn main() {
use std::path::PathBuf;
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-changed=./assets/obs-dummy.dll");
println!("cargo:rerun-if-env-changed=CARGO_PKG_VERSION");
if std::env::var("TOP_SECRET_NO_DUMMY_DLL").is_ok() {
return;
}
let dll = include_bytes!("./assets/obs-dummy.dll");
let out_dir = PathBuf::from(std::env::var("OUT_DIR").unwrap());
let target_dir = out_dir
.ancestors()
.nth(3) .unwrap();
let obs_dll_file = target_dir.join("obs.dll");
std::fs::write(obs_dll_file, dll).unwrap();
}