diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2025-06-11 14:41:42 +0200 |
|---|---|---|
| committer | Alex Rønne Petersen <alex@alexrp.com> | 2025-07-06 01:00:18 +0200 |
| commit | b461d07a5464aec86c533434dab0b58edfffb331 (patch) | |
| tree | d3e19fc63623fb765ff08757c069e27d915ef66e /build.zig | |
| parent | 044ccf4138f8b027be01c95ad759d5302e2ff39d (diff) | |
| download | zig-b461d07a5464aec86c533434dab0b58edfffb331.tar.gz zig-b461d07a5464aec86c533434dab0b58edfffb331.zip | |
Sema: Stop adding Windows implib link inputs for `extern "..."` syntax.
Closes #23971.
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -450,6 +450,7 @@ pub fn build(b: *std.Build) !void { .desc = "Run the behavior tests", .optimize_modes = optimization_modes, .include_paths = &.{}, + .windows_libs = &.{}, .skip_single_threaded = skip_single_threaded, .skip_non_native = skip_non_native, .skip_freebsd = skip_freebsd, @@ -472,6 +473,7 @@ pub fn build(b: *std.Build) !void { .desc = "Run the @cImport tests", .optimize_modes = optimization_modes, .include_paths = &.{"test/c_import"}, + .windows_libs = &.{}, .skip_single_threaded = true, .skip_non_native = skip_non_native, .skip_freebsd = skip_freebsd, @@ -492,6 +494,7 @@ pub fn build(b: *std.Build) !void { .desc = "Run the compiler_rt tests", .optimize_modes = optimization_modes, .include_paths = &.{}, + .windows_libs = &.{}, .skip_single_threaded = true, .skip_non_native = skip_non_native, .skip_freebsd = skip_freebsd, @@ -513,6 +516,7 @@ pub fn build(b: *std.Build) !void { .desc = "Run the zigc tests", .optimize_modes = optimization_modes, .include_paths = &.{}, + .windows_libs = &.{}, .skip_single_threaded = true, .skip_non_native = skip_non_native, .skip_freebsd = skip_freebsd, @@ -534,6 +538,12 @@ pub fn build(b: *std.Build) !void { .desc = "Run the standard library tests", .optimize_modes = optimization_modes, .include_paths = &.{}, + .windows_libs = &.{ + "advapi32", + "crypt32", + "iphlpapi", + "ws2_32", + }, .skip_single_threaded = skip_single_threaded, .skip_non_native = skip_non_native, .skip_freebsd = skip_freebsd, @@ -731,6 +741,12 @@ fn addCompilerMod(b: *std.Build, options: AddCompilerModOptions) *std.Build.Modu compiler_mod.addImport("aro", aro_mod); compiler_mod.addImport("aro_translate_c", aro_translate_c_mod); + if (options.target.result.os.tag == .windows) { + compiler_mod.linkSystemLibrary("advapi32", .{}); + compiler_mod.linkSystemLibrary("crypt32", .{}); + compiler_mod.linkSystemLibrary("ws2_32", .{}); + } + return compiler_mod; } @@ -1428,6 +1444,10 @@ fn generateLangRef(b: *std.Build) std.Build.LazyPath { }), }); + if (b.graph.host.result.os.tag == .windows) { + doctest_exe.root_module.linkSystemLibrary("advapi32", .{}); + } + var dir = b.build_root.handle.openDir("doc/langref", .{ .iterate = true }) catch |err| { std.debug.panic("unable to open '{}doc/langref' directory: {s}", .{ b.build_root, @errorName(err), |
