| ... | @@ -128,19 +128,17 @@ pub fn getExternalExecutor( | ... | @@ -128,19 +128,17 @@ pub fn getExternalExecutor( |
| 128 | switch (candidate.os.tag) { | 128 | switch (candidate.os.tag) { |
| 129 | .windows => { | 129 | .windows => { |
| 130 | if (options.allow_wine) { | 130 | if (options.allow_wine) { |
| 131 | // x86_64 wine does not support emulating aarch64-windows and | 131 | const wine_supported = switch (candidate.cpu.arch) { |
| 132 | // vice versa. | 132 | .thumb => switch (host.cpu.arch) { |
| 133 | if (candidate.cpu.arch != builtin.cpu.arch and | 133 | .arm, .thumb, .aarch64 => true, |
| 134 | !(candidate.cpu.arch == .thumb and builtin.cpu.arch == .aarch64) and | 134 | else => false, |
| 135 | !(candidate.cpu.arch == .x86 and builtin.cpu.arch == .x86_64)) | 135 | }, |
| 136 | { | 136 | .aarch64 => host.cpu.arch == .aarch64, |
| 137 | return bad_result; | 137 | .x86 => host.cpu.arch.isX86(), |
| 138 | } | 138 | .x86_64 => host.cpu.arch == .x86_64, |
| 139 | switch (candidate.ptrBitWidth()) { | 139 | else => false, |
| 140 | 32 => return Executor{ .wine = "wine" }, | 140 | }; |
| 141 | 64 => return Executor{ .wine = "wine64" }, | 141 | return if (wine_supported) Executor{ .wine = "wine" } else bad_result; |
| 142 | else => return bad_result, | | |
| 143 | } | | |
| 144 | } | 142 | } |
| 145 | return bad_result; | 143 | return bad_result; |
| 146 | }, | 144 | }, |