| ... | @@ -3402,7 +3402,14 @@ fn detectLibCIncludeDirs( | ... | @@ -3402,7 +3402,14 @@ fn detectLibCIncludeDirs( |
| 3402 | | 3402 | |
| 3403 | // If zig can't build the libc for the target and we are targeting the | 3403 | // If zig can't build the libc for the target and we are targeting the |
| 3404 | // native abi, fall back to using the system libc installation. | 3404 | // native abi, fall back to using the system libc installation. |
| 3405 | if (is_native_abi) { | 3405 | // On windows, instead of the native (mingw) abi, we want to check |
| | 3406 | // for the MSVC abi as a fallback. |
| | 3407 | const use_system_abi = if (std.Target.current.os.tag == .windows) |
| | 3408 | target.abi == .msvc |
| | 3409 | else |
| | 3410 | is_native_abi; |
| | 3411 | |
| | 3412 | if (use_system_abi) { |
| 3406 | const libc = try arena.create(LibCInstallation); | 3413 | const libc = try arena.create(LibCInstallation); |
| 3407 | libc.* = try LibCInstallation.findNative(.{ .allocator = arena, .verbose = true }); | 3414 | libc.* = try LibCInstallation.findNative(.{ .allocator = arena, .verbose = true }); |
| 3408 | return detectLibCFromLibCInstallation(arena, target, libc); | 3415 | return detectLibCFromLibCInstallation(arena, target, libc); |