Skip to content

Commit

Permalink
build: Disable default import library emission for .exe and MinGW `…
Browse files Browse the repository at this point in the history
….dll`

Aligns with other compilers' behavior.
  • Loading branch information
Doekin committed Jan 30, 2025
1 parent 3e1d1bb commit 5d5219b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3332,6 +3332,12 @@ fn buildOutputType(
fatal("the argument -femit-implib is allowed only when building a Windows DLL", .{});
}
}
// Do not emit import library by default for MinGW targets or executables
if (emit_implib == .yes_default_path and !emit_implib_arg_provided) {
if (target.abi.isGnu() or create_module.resolved_options.output_mode == .Exe) {
emit_implib = .no;
}
}
const default_implib_basename = if (target.abi.isGnu())
try std.fmt.allocPrint(arena, "lib{s}.dll.a", .{root_name})
else
Expand Down

0 comments on commit 5d5219b

Please sign in to comment.