authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-04-16 22:33:34-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-04-16 22:33:34-04:00
log96ebd8b23b39e2d4019a8019a6774d7c3d20149d
tree87c2c6713f1c75a3a7bbbcc8bc3571bab4226130
parentc7cb5c31e5b0cb9a88365c1264bfddf3c50ed107

fix windows not respecting --msvc-lib-dir, --kernel32-lib-dir

I believe this was a regression caused by 51a6ff18d454f4cb0faa0f1837df9f0c55a80b43 closes #927

1 files changed, 18 insertions(+), 12 deletions(-)

src/analyze.cpp+18-12
...@@ -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);
44234423
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 }
44284431
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 }
44334439
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 }
44384447
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 {