From 2d855745f91852af92ad970feef96e55919993d3 Mon Sep 17 00:00:00 2001 From: Martin Wickham Date: Sat, 10 Jul 2021 15:55:38 -0500 Subject: Fix libc include directories for the MSVC target --- src/Compilation.zig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Compilation.zig b/src/Compilation.zig index 58425197c1..625de58c63 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -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); -- cgit v1.2.3