| ... | @@ -4421,24 +4421,30 @@ void find_libc_lib_path(CodeGen *g) { | ... | @@ -4421,24 +4421,30 @@ void find_libc_lib_path(CodeGen *g) { |
| 4421 | if (g->zig_target.os == OsWindows) { | 4421 | if (g->zig_target.os == OsWindows) { |
| 4422 | ZigWindowsSDK *sdk = get_windows_sdk(g); | 4422 | ZigWindowsSDK *sdk = get_windows_sdk(g); |
| 4423 | | 4423 | |
| 4424 | Buf* vc_lib_dir = buf_alloc(); | 4424 | if (g->msvc_lib_dir == nullptr) { |
| 4425 | if (os_get_win32_vcruntime_path(vc_lib_dir, g->zig_target.arch.arch)) { | 4425 | Buf* vc_lib_dir = buf_alloc(); |
| 4426 | zig_panic("Unable to determine vcruntime path."); | 4426 | if (os_get_win32_vcruntime_path(vc_lib_dir, g->zig_target.arch.arch)) { |
| | 4427 | zig_panic("Unable to determine vcruntime path."); |
| | 4428 | } |
| | 4429 | g->msvc_lib_dir = vc_lib_dir; |
| 4427 | } | 4430 | } |
| 4428 | | 4431 | |
| 4429 | Buf* ucrt_lib_path = buf_alloc(); | 4432 | if (g->libc_lib_dir == nullptr) { |
| 4430 | if (os_get_win32_ucrt_lib_path(sdk, ucrt_lib_path, g->zig_target.arch.arch)) { | 4433 | Buf* ucrt_lib_path = buf_alloc(); |
| 4431 | zig_panic("Unable to determine ucrt path."); | 4434 | if (os_get_win32_ucrt_lib_path(sdk, ucrt_lib_path, g->zig_target.arch.arch)) { |
| | 4435 | zig_panic("Unable to determine ucrt path."); |
| | 4436 | } |
| | 4437 | g->libc_lib_dir = ucrt_lib_path; |
| 4432 | } | 4438 | } |
| 4433 | | 4439 | |
| 4434 | Buf* kern_lib_path = buf_alloc(); | 4440 | if (g->kernel32_lib_dir == nullptr) { |
| 4435 | if (os_get_win32_kern32_path(sdk, kern_lib_path, g->zig_target.arch.arch)) { | 4441 | Buf* kern_lib_path = buf_alloc(); |
| 4436 | zig_panic("Unable to determine kernel32 path."); | 4442 | if (os_get_win32_kern32_path(sdk, kern_lib_path, g->zig_target.arch.arch)) { |
| | 4443 | zig_panic("Unable to determine kernel32 path."); |
| | 4444 | } |
| | 4445 | g->kernel32_lib_dir = kern_lib_path; |
| 4437 | } | 4446 | } |
| 4438 | | 4447 | |
| 4439 | g->msvc_lib_dir = vc_lib_dir; | | |
| 4440 | g->libc_lib_dir = ucrt_lib_path; | | |
| 4441 | g->kernel32_lib_dir = kern_lib_path; | | |
| 4442 | } else if (g->zig_target.os == OsLinux) { | 4448 | } else if (g->zig_target.os == OsLinux) { |
| 4443 | g->libc_lib_dir = get_linux_libc_lib_path("crt1.o"); | 4449 | g->libc_lib_dir = get_linux_libc_lib_path("crt1.o"); |
| 4444 | } else { | 4450 | } else { |