authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-12-06 12:46:59-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-12-06 12:46:59-07:00
log3f693cf5d51fbc53d32203e5a5faf69d4a49a099
treea366069fc741101c36cdcbbb42296464c82d4f81
parentbf316e550671cc71eb498b3cf799493627bb0fdc

CLI: quality of life enhancement for windows CBE behavior tests

When testing with ``` stage4/bin/zig test ../test/behavior.zig -I../test -ofmt=c -target x86_64-windows ``` previously, one would see this message: ``` error: lld-link: subsystem must be defined ``` Now, `--subsystem console` as well as `-lntdll -lkernel32` are on the `zig run` line, producing a binary.

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

src/main.zig+9-1
......@@ -3059,7 +3059,15 @@ fn buildOutputType(
30593059 try test_exec_args.appendSlice(&.{ "-I", p });
30603060 }
30613061
3062 if (link_libc) try test_exec_args.append("-lc");
3062 if (link_libc) {
3063 try test_exec_args.append("-lc");
3064 } else if (target_info.target.os.tag == .windows) {
3065 try test_exec_args.appendSlice(&.{
3066 "--subsystem", "console",
3067 "-lkernel32", "-lntdll",
3068 });
3069 }
3070
30633071 if (!mem.eql(u8, target_arch_os_abi, "native")) {
30643072 try test_exec_args.append("-target");
30653073 try test_exec_args.append(target_arch_os_abi);