diff options
| author | Martin Wickham <spexguy070@gmail.com> | 2021-07-10 15:55:38 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-07-10 17:00:42 -0400 |
| commit | 2d855745f91852af92ad970feef96e55919993d3 (patch) | |
| tree | 28604045587d4b2117a187eff8328e24ccfd6349 /src/Compilation.zig | |
| parent | a3703745eb21923b96e807b9163d303b8e4447b7 (diff) | |
| download | zig-2d855745f91852af92ad970feef96e55919993d3.tar.gz zig-2d855745f91852af92ad970feef96e55919993d3.zip | |
Fix libc include directories for the MSVC target
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 9 |
1 files changed, 8 insertions, 1 deletions
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); |
