Files
wasmtime/winch/codegen/build.rs
Alex Crichton b23691032b Fix default architecture for winch (#6242)
* Fix default architecture for winch

This updates the `winch/codegen/build.rs` script to default to the
target architecture being compiled for as opposed to the host
architecture that's performing the compile.

Closes #6241

* Auto-enable other future architectures
2023-04-19 19:45:48 +00:00

17 lines
482 B
Rust

fn main() {
if cfg!(feature = "x64") || cfg!(feature = "arm64") || cfg!(feature = "all-arch") {
return;
}
let arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap();
if arch == "x86_64" {
println!("cargo:rustc-cfg=feature=\"x64\"");
} else if arch == "aarch64" {
println!("cargo:rustc-cfg=feature=\"arm64\"");
} else {
println!("cargo:rustc-cfg=feature=\"{arch}\"");
}
println!("cargo:rerun-if-changed=build.rs");
}