Skip to content

Commit bb79c85

Browse files
xxxbxxxalexrp
authored andcommitted
fix system library lookup when cross-compiling to windows-msvc
1 parent dffd18f commit bb79c85

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/main.zig

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4155,7 +4155,7 @@ fn createModule(
41554155
};
41564156
}
41574157

4158-
if (builtin.target.os.tag == .windows and (target.abi == .msvc or target.abi == .itanium) and
4158+
if (target.os.tag == .windows and (target.abi == .msvc or target.abi == .itanium) and
41594159
any_name_queries_remaining)
41604160
{
41614161
if (create_module.libc_installation == null) {
@@ -4166,11 +4166,10 @@ fn createModule(
41664166
}) catch |err| {
41674167
fatal("unable to find native libc installation: {s}", .{@errorName(err)});
41684168
};
4169-
4170-
try create_module.lib_directories.ensureUnusedCapacity(arena, 2);
4171-
addLibDirectoryWarn(&create_module.lib_directories, create_module.libc_installation.?.msvc_lib_dir.?);
4172-
addLibDirectoryWarn(&create_module.lib_directories, create_module.libc_installation.?.kernel32_lib_dir.?);
41734169
}
4170+
try create_module.lib_directories.ensureUnusedCapacity(arena, 2);
4171+
addLibDirectoryWarn(&create_module.lib_directories, create_module.libc_installation.?.msvc_lib_dir.?);
4172+
addLibDirectoryWarn(&create_module.lib_directories, create_module.libc_installation.?.kernel32_lib_dir.?);
41744173
}
41754174

41764175
// Destructively mutates but does not transfer ownership of `unresolved_link_inputs`.

0 commit comments

Comments
 (0)