test-standalone: explicitly link to advapi32 sometimes

Now, nearly every object produced by zig has a dependency on
advapi32.dll due to the dependency on RtlGenRandom due to the
implementation of dirCreateFileAtomic which is now analyzed whether or
not it is used.
This commit is contained in:
Andrew Kelley
2026-01-04 23:20:02 -08:00
parent 75f417108c
commit 36044a0e81
3 changed files with 3 additions and 0 deletions
+1
View File
@@ -32,6 +32,7 @@ pub fn build(b: *std.Build) void {
}),
});
exe.subsystem = .console;
exe.root_module.linkSystemLibrary("advapi32", .{}); // for RtlGenRandom
exe.root_module.linkSystemLibrary("kernel32", .{});
exe.root_module.linkSystemLibrary("ntdll", .{});
exe.root_module.addObject(obj);
@@ -12,6 +12,7 @@ pub fn build(b: *std.Build) void {
test_obj.root_module.linkSystemLibrary("ntdll", .{});
test_obj.root_module.linkSystemLibrary("kernel32", .{});
test_obj.root_module.linkSystemLibrary("ws2_32", .{});
test_obj.root_module.linkSystemLibrary("advapi32", .{}); // for RtlGenRandom
}
const test_exe_mod = b.createModule(.{
+1
View File
@@ -86,6 +86,7 @@ pub fn build(b: *std.Build) !void {
.optimize = optimize,
}),
});
lib_msvc.root_module.linkSystemLibrary("advapi32", .{}); // for RtlGenRandom
const verify_msvc = b.addExecutable(.{
.name = "verify-msvc",
.root_module = b.createModule(.{