Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/Compilation.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3402,7 +3402,14 @@ fn detectLibCIncludeDirs(

// If zig can't build the libc for the target and we are targeting the
// native abi, fall back to using the system libc installation.
if (is_native_abi) {
// On windows, instead of the native (mingw) abi, we want to check
// for the MSVC abi as a fallback.
const use_system_abi = if (std.Target.current.os.tag == .windows)
target.abi == .msvc
else
is_native_abi;

if (use_system_abi) {
const libc = try arena.create(LibCInstallation);
libc.* = try LibCInstallation.findNative(.{ .allocator = arena, .verbose = true });
return detectLibCFromLibCInstallation(arena, target, libc);
Expand Down