authorgravatar for spexguy070@gmail.comMartin Wickham <spexguy070@gmail.com> 2021-07-10 15:55:38-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-07-21 12:22:09-07:00
log3dcbd489eba48107443a514e5470e1a58d6691d9
tree0f88ca42c3b35c3639b52fbab4ac60b5878ff140
parent5582d20f044c6891038d20d6057c61a3df829714

Fix libc include directories for the MSVC target


1 files changed, 8 insertions(+), 1 deletions(-)

src/Compilation.zig+8-1
...@@ -3295,7 +3295,14 @@ fn detectLibCIncludeDirs(...@@ -3295,7 +3295,14 @@ fn detectLibCIncludeDirs(
32953295
3296 // If zig can't build the libc for the target and we are targeting the3296 // If zig can't build the libc for the target and we are targeting the
3297 // native abi, fall back to using the system libc installation.3297 // native abi, fall back to using the system libc installation.
3298 if (is_native_abi) {3298 // On windows, instead of the native (mingw) abi, we want to check
3299 // for the MSVC abi as a fallback.
3300 const use_system_abi = if (std.Target.current.os.tag == .windows)
3301 target.abi == .msvc
3302 else
3303 is_native_abi;
3304
3305 if (use_system_abi) {
3299 const libc = try arena.create(LibCInstallation);3306 const libc = try arena.create(LibCInstallation);
3300 libc.* = try LibCInstallation.findNative(.{ .allocator = arena, .verbose = true });3307 libc.* = try LibCInstallation.findNative(.{ .allocator = arena, .verbose = true });
3301 return detectLibCFromLibCInstallation(arena, target, libc);3308 return detectLibCFromLibCInstallation(arena, target, libc);