@@ -312,7 +312,6 @@ fn mainArgs(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {
312312 return jitCmd (gpa , arena , cmd_args , .{
313313 .cmd_name = "resinator" ,
314314 .root_src_path = "resinator/main.zig" ,
315- .windows_libs = &.{"advapi32" },
316315 .depend_on_aro = true ,
317316 .prepend_zig_lib_dir_path = true ,
318317 .server = use_server ,
@@ -337,7 +336,6 @@ fn mainArgs(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {
337336 return jitCmd (gpa , arena , cmd_args , .{
338337 .cmd_name = "std" ,
339338 .root_src_path = "std-docs.zig" ,
340- .windows_libs = &.{"ws2_32" },
341339 .prepend_zig_lib_dir_path = true ,
342340 .prepend_zig_exe_path = true ,
343341 .prepend_global_cache_path = true ,
@@ -3659,6 +3657,7 @@ fn buildOutputType(
36593657 } else if (target .os .tag == .windows ) {
36603658 try test_exec_args .appendSlice (arena , &.{
36613659 "--subsystem" , "console" ,
3660+ "-lkernel32" , "-lntdll" ,
36623661 });
36633662 }
36643663
@@ -3862,8 +3861,7 @@ fn createModule(
38623861 .only_compiler_rt = > continue ,
38633862 }
38643863
3865- // We currently prefer import libraries provided by MinGW-w64 even for MSVC.
3866- if (target .os .tag == .windows ) {
3864+ if (target .isMinGW ()) {
38673865 const exists = mingw .libExists (arena , target , create_module .dirs .zig_lib , lib_name ) catch | err | {
38683866 fatal ("failed to check zig installation for DLL import libs: {s}" , .{
38693867 @errorName (err ),
@@ -5375,14 +5373,6 @@ fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {
53755373
53765374 try root_mod .deps .put (arena , "@build" , build_mod );
53775375
5378- var windows_libs : std .StringArrayHashMapUnmanaged (void ) = .empty ;
5379-
5380- if (resolved_target .result .os .tag == .windows ) {
5381- try windows_libs .ensureUnusedCapacity (arena , 2 );
5382- windows_libs .putAssumeCapacity ("advapi32" , {});
5383- windows_libs .putAssumeCapacity ("ws2_32" , {}); // for `--listen` (web interface)
5384- }
5385-
53865376 const comp = Compilation .create (gpa , arena , .{
53875377 .libc_installation = libc_installation ,
53885378 .dirs = dirs ,
@@ -5405,7 +5395,6 @@ fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {
54055395 .cache_mode = .whole ,
54065396 .reference_trace = reference_trace ,
54075397 .debug_compile_errors = debug_compile_errors ,
5408- .windows_lib_names = windows_libs .keys (),
54095398 }) catch | err | {
54105399 fatal ("unable to create compilation: {s}" , .{@errorName (err )});
54115400 };
@@ -5509,7 +5498,6 @@ fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {
55095498const JitCmdOptions = struct {
55105499 cmd_name : []const u8 ,
55115500 root_src_path : []const u8 ,
5512- windows_libs : []const []const u8 = &.{},
55135501 prepend_zig_lib_dir_path : bool = false ,
55145502 prepend_global_cache_path : bool = false ,
55155503 prepend_zig_exe_path : bool = false ,
@@ -5626,13 +5614,6 @@ fn jitCmd(
56265614 try root_mod .deps .put (arena , "aro" , aro_mod );
56275615 }
56285616
5629- var windows_libs : std .StringArrayHashMapUnmanaged (void ) = .empty ;
5630-
5631- if (resolved_target .result .os .tag == .windows ) {
5632- try windows_libs .ensureUnusedCapacity (arena , options .windows_libs .len );
5633- for (options .windows_libs ) | lib | windows_libs .putAssumeCapacity (lib , {});
5634- }
5635-
56365617 const comp = Compilation .create (gpa , arena , .{
56375618 .dirs = dirs ,
56385619 .root_name = options .cmd_name ,
@@ -5643,7 +5624,6 @@ fn jitCmd(
56435624 .self_exe_path = self_exe_path ,
56445625 .thread_pool = & thread_pool ,
56455626 .cache_mode = .whole ,
5646- .windows_lib_names = windows_libs .keys (),
56475627 }) catch | err | {
56485628 fatal ("unable to create compilation: {s}" , .{@errorName (err )});
56495629 };
0 commit comments