| ... | @@ -15,8 +15,6 @@ const Target = std.Target; | ... | @@ -15,8 +15,6 @@ const Target = std.Target; |
| 15 | const CrossTarget = std.zig.CrossTarget; | 15 | const CrossTarget = std.zig.CrossTarget; |
| 16 | const macos = @import("system/macos.zig"); | 16 | const macos = @import("system/macos.zig"); |
| 17 | | 17 | |
| 18 | const is_windows = Target.current.os.tag == .windows; | | |
| 19 | | | |
| 20 | pub const getSDKPath = macos.getSDKPath; | 18 | pub const getSDKPath = macos.getSDKPath; |
| 21 | | 19 | |
| 22 | pub const NativePaths = struct { | 20 | pub const NativePaths = struct { |
| ... | @@ -26,7 +24,9 @@ pub const NativePaths = struct { | ... | @@ -26,7 +24,9 @@ pub const NativePaths = struct { |
| 26 | rpaths: ArrayList([:0]u8), | 24 | rpaths: ArrayList([:0]u8), |
| 27 | warnings: ArrayList([:0]u8), | 25 | warnings: ArrayList([:0]u8), |
| 28 | | 26 | |
| 29 | pub fn detect(allocator: *Allocator) !NativePaths { | 27 | pub fn detect(allocator: *Allocator, native_info: NativeTargetInfo) !NativePaths { |
| | 28 | const native_target = native_info.target; |
| | 29 | |
| 30 | var self: NativePaths = .{ | 30 | var self: NativePaths = .{ |
| 31 | .include_dirs = ArrayList([:0]u8).init(allocator), | 31 | .include_dirs = ArrayList([:0]u8).init(allocator), |
| 32 | .lib_dirs = ArrayList([:0]u8).init(allocator), | 32 | .lib_dirs = ArrayList([:0]u8).init(allocator), |
| ... | @@ -103,9 +103,9 @@ pub const NativePaths = struct { | ... | @@ -103,9 +103,9 @@ pub const NativePaths = struct { |
| 103 | return self; | 103 | return self; |
| 104 | } | 104 | } |
| 105 | | 105 | |
| 106 | if (!is_windows) { | 106 | if (native_target.os.tag != .windows) { |
| 107 | const triple = try Target.current.linuxTriple(allocator); | 107 | const triple = try native_target.linuxTriple(allocator); |
| 108 | const qual = Target.current.cpu.arch.ptrBitWidth(); | 108 | const qual = native_target.cpu.arch.ptrBitWidth(); |
| 109 | | 109 | |
| 110 | // TODO: $ ld --verbose | grep SEARCH_DIR | 110 | // TODO: $ ld --verbose | grep SEARCH_DIR |
| 111 | // the output contains some paths that end with lib64, maybe include them too? | 111 | // the output contains some paths that end with lib64, maybe include them too? |