Skip to content

Commit de81c50

Browse files
committed
CLI: allow -femit-implib when building .exe files too
1 parent 0812b57 commit de81c50

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/main.zig

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2237,11 +2237,14 @@ fn buildOutputType(
22372237
};
22382238
defer emit_docs_resolved.deinit();
22392239

2240-
const is_dyn_lib = switch (output_mode) {
2241-
.Obj, .Exe => false,
2240+
const is_exe_or_dyn_lib = switch (output_mode) {
2241+
.Obj => false,
22422242
.Lib => (link_mode orelse .Static) == .Dynamic,
2243+
.Exe => true,
22432244
};
2244-
const implib_eligible = is_dyn_lib and
2245+
// Note that cmake when targeting Windows will try to execute
2246+
// zig cc to make an executable and output an implib too.
2247+
const implib_eligible = is_exe_or_dyn_lib and
22452248
emit_bin_loc != null and target_info.target.os.tag == .windows;
22462249
if (!implib_eligible) {
22472250
if (!emit_implib_arg_provided) {

0 commit comments

Comments
 (0)