mirror of
https://github.com/fluencelabs/wasmer
synced 2025-03-16 08:10:49 +00:00
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
This commit is contained in:
parent
4de7deb568
commit
9e389b9a5f
@ -1,12 +1,8 @@
|
||||
fn main() {
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
use cmake::Config;
|
||||
let project_name = "exception_handling";
|
||||
let dst = Config::new(project_name).build();
|
||||
println!("cargo:rustc-link-search=native={}", dst.display());
|
||||
println!("cargo:rustc-link-lib=static={}", project_name);
|
||||
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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user