authorgravatar for xq@random-projects.netFelix "xq" Queißner <xq@random-projects.net> 2023-07-27 08:37:07+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-07-30 11:18:50-07:00
logf8386de7ae12fca1e50e7920964fd7c47301fc05
treed895d602d72ce511afdc15cce70ceae76e193430
parentae11fba44a61f4ccb81875633a4203116167509c

Tries to fix Windows DLL linking.


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

lib/std/Build/Step/Compile.zig+4-4
......@@ -1200,8 +1200,8 @@ pub fn setExecCmd(self: *Compile, args: []const ?[]const u8) void {
12001200fn linkLibraryOrObject(self: *Compile, other: *Compile) void {
12011201 other.forceEmit(.bin);
12021202
1203 if (other.kind == .lib and other.target.isWindows()) { // TODO(xq): Is this the correct logic here?
1204 _ = other.getEmittedImplib(); // Force emission of the binary
1203 if (other.target.isWindows() and other.isDynamicLibrary()) { // TODO(xq): Is this the correct logic here?
1204 other.forceEmit(.implib);
12051205 }
12061206
12071207 self.step.dependOn(&other.step);
......@@ -1434,9 +1434,9 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void {
14341434
14351435 // TODO(xq): Is that the right way?
14361436 const full_path_lib = if (other.isDynamicLibrary() and other.target.isWindows())
1437 other.getGeneratedFilePath("generated_implib", &self.step)
1437 other.getGeneratedFilePath("generated_implib", &self.step) // For DLLs, we gotta link against the implib,
14381438 else
1439 other.getGeneratedFilePath("generated_bin", &self.step);
1439 other.getGeneratedFilePath("generated_bin", &self.step); // for everything else, we directly link against the library file
14401440 try zig_args.append(full_path_lib);
14411441
14421442 if (other.linkage == Linkage.dynamic and !self.target.isWindows()) {