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