wasmer/lib/win-exception-handler/build.rs
Jake Shadle 9e389b9a5f Fix cross compilation
cfg!()/env!() are applied on the host platform during the build script's
build, the environment of the build script's execution is the proper way
to determine eg target_os
2020-03-18 20:06:55 +01:00

11 lines
287 B
Rust

fn main() {
if std::env::var("CARGO_CFG_TARGET_OS").expect("TARGET_OS not specified") != "windows" {
return;
}
cc::Build::new()
.include("exception_handling")
.file("exception_handling/exception_handling.c")
.compile("exception_handling");
}