| ... | @@ -168,29 +168,22 @@ pub const LibCInstallation = struct { | ... | @@ -168,29 +168,22 @@ pub const LibCInstallation = struct { |
| 168 | var self: LibCInstallation = .{}; | 168 | var self: LibCInstallation = .{}; |
| 169 | | 169 | |
| 170 | if (is_windows) { | 170 | if (is_windows) { |
| 171 | if (is_gnu) { | 171 | var sdk: *ZigWindowsSDK = undefined; |
| 172 | var batch = Batch(FindError!void, 3, .auto_async).init(); | 172 | switch (zig_find_windows_sdk(&sdk)) { |
| 173 | batch.add(&async self.findNativeIncludeDirPosix(args)); | 173 | .None => { |
| 174 | batch.add(&async self.findNativeCrtDirPosix(args)); | 174 | defer zig_free_windows_sdk(sdk); |
| 175 | try batch.wait(); | 175 | |
| 176 | } else { | 176 | var batch = Batch(FindError!void, 5, .auto_async).init(); |
| 177 | var sdk: *ZigWindowsSDK = undefined; | 177 | batch.add(&async self.findNativeMsvcIncludeDir(args, sdk)); |
| 178 | switch (zig_find_windows_sdk(&sdk)) { | 178 | batch.add(&async self.findNativeMsvcLibDir(args, sdk)); |
| 179 | .None => { | 179 | batch.add(&async self.findNativeKernel32LibDir(args, sdk)); |
| 180 | defer zig_free_windows_sdk(sdk); | 180 | batch.add(&async self.findNativeIncludeDirWindows(args, sdk)); |
| 181 | | 181 | batch.add(&async self.findNativeCrtDirWindows(args, sdk)); |
| 182 | var batch = Batch(FindError!void, 5, .auto_async).init(); | 182 | try batch.wait(); |
| 183 | batch.add(&async self.findNativeMsvcIncludeDir(args, sdk)); | 183 | }, |
| 184 | batch.add(&async self.findNativeMsvcLibDir(args, sdk)); | 184 | .OutOfMemory => return error.OutOfMemory, |
| 185 | batch.add(&async self.findNativeKernel32LibDir(args, sdk)); | 185 | .NotFound => return error.WindowsSdkNotFound, |
| 186 | batch.add(&async self.findNativeIncludeDirWindows(args, sdk)); | 186 | .PathTooLong => return error.WindowsSdkNotFound, |
| 187 | batch.add(&async self.findNativeCrtDirWindows(args, sdk)); | | |
| 188 | try batch.wait(); | | |
| 189 | }, | | |
| 190 | .OutOfMemory => return error.OutOfMemory, | | |
| 191 | .NotFound => return error.WindowsSdkNotFound, | | |
| 192 | .PathTooLong => return error.WindowsSdkNotFound, | | |
| 193 | } | | |
| 194 | } | 187 | } |
| 195 | } else { | 188 | } else { |
| 196 | try blk: { | 189 | try blk: { |