| ... | ... | @@ -1014,18 +1014,22 @@ pub const Target = struct { |
| 1014 | 1014 | return libPrefix_cpu_arch_abi(self.cpu.arch, self.abi); |
| 1015 | 1015 | } |
| 1016 | 1016 | |
| 1017 | | pub fn getObjectFormat(self: Target) ObjectFormat { |
| 1018 | | if (self.os.tag == .windows or self.os.tag == .uefi) { |
| 1017 | pub fn getObjectFormatSimple(os_tag: Os.Tag, cpu_arch: Cpu.Arch) ObjectFormat { |
| 1018 | if (os_tag == .windows or os_tag == .uefi) { |
| 1019 | 1019 | return .coff; |
| 1020 | | } else if (self.isDarwin()) { |
| 1020 | } else if (os_tag.isDarwin()) { |
| 1021 | 1021 | return .macho; |
| 1022 | 1022 | } |
| 1023 | | if (self.cpu.arch.isWasm()) { |
| 1023 | if (cpu_arch.isWasm()) { |
| 1024 | 1024 | return .wasm; |
| 1025 | 1025 | } |
| 1026 | 1026 | return .elf; |
| 1027 | 1027 | } |
| 1028 | 1028 | |
| 1029 | pub fn getObjectFormat(self: Target) ObjectFormat { |
| 1030 | return getObjectFormatSimple(self.os.tag, self.cpu.arch); |
| 1031 | } |
| 1032 | |
| 1029 | 1033 | pub fn isMinGW(self: Target) bool { |
| 1030 | 1034 | return self.os.tag == .windows and self.isGnu(); |
| 1031 | 1035 | } |