authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-12-07 01:17:50-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-12-07 01:17:50-07:00
logde81c504b187279e6daba30df9673835f7f6c1eb
treec17ef1b473da6d60e88e87281a6c627a0df91c52
parent0812b5746622c4263ad0fcf23bea847a547b0c4d

CLI: allow `-femit-implib` when building .exe files too


1 files changed, 6 insertions(+), 3 deletions(-)

src/main.zig+6-3
......@@ -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) {