|
@@ -174,22 +174,17 @@ pub fn command(options: Options) -> Result<()> {
|
|
// move merge modules to the out dir so the bundler can load it
|
|
// move merge modules to the out dir so the bundler can load it
|
|
#[cfg(windows)]
|
|
#[cfg(windows)]
|
|
{
|
|
{
|
|
- let arch = if let Some(t) = &options.target {
|
|
|
|
- if t.starts_with("x86_64") {
|
|
|
|
- "x86_64"
|
|
|
|
- } else if t.starts_with('i') {
|
|
|
|
- "x86"
|
|
|
|
- } else if t.starts_with("arm") {
|
|
|
|
- "arm"
|
|
|
|
- } else if t.starts_with("aarch64") {
|
|
|
|
- "aarch64"
|
|
|
|
- } else {
|
|
|
|
- panic!("Unexpected target triple {}", t)
|
|
|
|
- }
|
|
|
|
- } else if cfg!(target_arch = "x86") {
|
|
|
|
|
|
+ let target = options.target.clone().unwrap_or_else(|| std::env::consts::ARCH.into());
|
|
|
|
+ let arch = if target.starts_with("x86_64") {
|
|
|
|
+ "x86_64"
|
|
|
|
+ } else if target.starts_with('i') || target.starts_with("x86") {
|
|
"x86"
|
|
"x86"
|
|
|
|
+ } else if target.starts_with("arm") {
|
|
|
|
+ "arm"
|
|
|
|
+ } else if target.starts_with("aarch64") {
|
|
|
|
+ "aarch64"
|
|
} else {
|
|
} else {
|
|
- "x86_64"
|
|
|
|
|
|
+ panic!("Unexpected target architecture {}", target.split("_").next().unwrap())
|
|
};
|
|
};
|
|
let (filename, vcruntime_msm) = if arch == "x86" {
|
|
let (filename, vcruntime_msm) = if arch == "x86" {
|
|
let _ = std::fs::remove_file(out_dir.join("Microsoft_VC142_CRT_x64.msm"));
|
|
let _ = std::fs::remove_file(out_dir.join("Microsoft_VC142_CRT_x64.msm"));
|