Skip to content

Commit 8f962a9

Browse files
committed
fix regressions on windows
1 parent c3724ec commit 8f962a9

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/analyze.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4378,6 +4378,7 @@ void find_libc_include_path(CodeGen *g) {
43784378

43794379
if (g->zig_target.os == OsWindows) {
43804380
ZigWindowsSDK *sdk = get_windows_sdk(g);
4381+
g->libc_include_dir = buf_alloc();
43814382
if (os_get_win32_ucrt_include_path(sdk, g->libc_include_dir)) {
43824383
zig_panic("Unable to determine libc include path.");
43834384
}

src/link.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,9 @@ static void construct_linker_job_coff(LinkJob *lj) {
455455
lj->args.append(buf_ptr(buf_sprintf("-LIBPATH:%s", buf_ptr(g->kernel32_lib_dir))));
456456

457457
lj->args.append(buf_ptr(buf_sprintf("-LIBPATH:%s", buf_ptr(g->libc_lib_dir))));
458-
lj->args.append(buf_ptr(buf_sprintf("-LIBPATH:%s", buf_ptr(g->libc_static_lib_dir))));
458+
if (g->libc_static_lib_dir != nullptr) {
459+
lj->args.append(buf_ptr(buf_sprintf("-LIBPATH:%s", buf_ptr(g->libc_static_lib_dir))));
460+
}
459461
}
460462

461463
if (lj->link_in_crt) {

0 commit comments

Comments
 (0)