| ... | @@ -3,7 +3,6 @@ const builtin = @import("builtin"); | ... | @@ -3,7 +3,6 @@ const builtin = @import("builtin"); |
| 3 | const Target = std.Target; | 3 | const Target = std.Target; |
| 4 | const fs = std.fs; | 4 | const fs = std.fs; |
| 5 | const Allocator = std.mem.Allocator; | 5 | const Allocator = std.mem.Allocator; |
| 6 | const Batch = std.event.Batch; | | |
| 7 | const build_options = @import("build_options"); | 6 | const build_options = @import("build_options"); |
| 8 | | 7 | |
| 9 | const is_darwin = builtin.target.isDarwin(); | 8 | const is_darwin = builtin.target.isDarwin(); |
| ... | @@ -195,40 +194,28 @@ pub const LibCInstallation = struct { | ... | @@ -195,40 +194,28 @@ pub const LibCInstallation = struct { |
| 195 | .None => { | 194 | .None => { |
| 196 | defer sdk.free(); | 195 | defer sdk.free(); |
| 197 | | 196 | |
| 198 | var batch = Batch(FindError!void, 5, .auto_async).init(); | 197 | try self.findNativeMsvcIncludeDir(args, sdk); |
| 199 | batch.add(&async self.findNativeMsvcIncludeDir(args, sdk)); | 198 | try self.findNativeMsvcLibDir(args, sdk); |
| 200 | batch.add(&async self.findNativeMsvcLibDir(args, sdk)); | 199 | try self.findNativeKernel32LibDir(args, sdk); |
| 201 | batch.add(&async self.findNativeKernel32LibDir(args, sdk)); | 200 | try self.findNativeIncludeDirWindows(args, sdk); |
| 202 | batch.add(&async self.findNativeIncludeDirWindows(args, sdk)); | 201 | try self.findNativeCrtDirWindows(args, sdk); |
| 203 | batch.add(&async self.findNativeCrtDirWindows(args, sdk)); | | |
| 204 | try batch.wait(); | | |
| 205 | }, | 202 | }, |
| 206 | .OutOfMemory => return error.OutOfMemory, | 203 | .OutOfMemory => return error.OutOfMemory, |
| 207 | .NotFound => return error.WindowsSdkNotFound, | 204 | .NotFound => return error.WindowsSdkNotFound, |
| 208 | .PathTooLong => return error.WindowsSdkNotFound, | 205 | .PathTooLong => return error.WindowsSdkNotFound, |
| 209 | } | 206 | } |
| 210 | } else if (is_haiku) { | 207 | } else if (is_haiku) { |
| 211 | try blk: { | 208 | try self.findNativeIncludeDirPosix(args); |
| 212 | var batch = Batch(FindError!void, 2, .auto_async).init(); | 209 | try self.findNativeCrtBeginDirHaiku(args); |
| 213 | errdefer batch.wait() catch {}; | 210 | self.crt_dir = try args.allocator.dupeZ(u8, "/system/develop/lib"); |
| 214 | batch.add(&async self.findNativeIncludeDirPosix(args)); | | |
| 215 | batch.add(&async self.findNativeCrtBeginDirHaiku(args)); | | |
| 216 | self.crt_dir = try args.allocator.dupeZ(u8, "/system/develop/lib"); | | |
| 217 | break :blk batch.wait(); | | |
| 218 | }; | | |
| 219 | } else if (std.process.can_spawn) { | 211 | } else if (std.process.can_spawn) { |
| 220 | try blk: { | 212 | try self.findNativeIncludeDirPosix(args); |
| 221 | var batch = Batch(FindError!void, 2, .auto_async).init(); | 213 | switch (builtin.target.os.tag) { |
| 222 | errdefer batch.wait() catch {}; | 214 | .freebsd, .netbsd, .openbsd, .dragonfly => self.crt_dir = try args.allocator.dupeZ(u8, "/usr/lib"), |
| 223 | batch.add(&async self.findNativeIncludeDirPosix(args)); | 215 | .solaris => self.crt_dir = try args.allocator.dupeZ(u8, "/usr/lib/64"), |
| 224 | switch (builtin.target.os.tag) { | 216 | .linux => try self.findNativeCrtDirPosix(args), |
| 225 | .freebsd, .netbsd, .openbsd, .dragonfly => self.crt_dir = try args.allocator.dupeZ(u8, "/usr/lib"), | 217 | else => {}, |
| 226 | .solaris => self.crt_dir = try args.allocator.dupeZ(u8, "/usr/lib/64"), | 218 | } |
| 227 | .linux => batch.add(&async self.findNativeCrtDirPosix(args)), | | |
| 228 | else => {}, | | |
| 229 | } | | |
| 230 | break :blk batch.wait(); | | |
| 231 | }; | | |
| 232 | } else { | 219 | } else { |
| 233 | return error.LibCRuntimeNotFound; | 220 | return error.LibCRuntimeNotFound; |
| 234 | } | 221 | } |