From cbb6d2239f84ee13279655fc591530a23301d188 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 16 Oct 2017 10:20:52 -0400 Subject: look for libc at runtime on windows See #539 before we close the issue we should also detect MSVC 2017 but this gets us started with supporting MSVC 2015 --- src/codegen.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/codegen.cpp') diff --git a/src/codegen.cpp b/src/codegen.cpp index 2ffb2c49c2..c8e339b8e3 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -117,6 +117,8 @@ CodeGen *codegen_create(Buf *root_src_path, const ZigTarget *target, OutType out g->libc_lib_dir = buf_create_from_str(""); g->libc_static_lib_dir = buf_create_from_str(""); g->libc_include_dir = buf_create_from_str(""); + g->msvc_lib_dir = nullptr; + g->kernel32_lib_dir = nullptr; g->each_lib_rpath = false; } else { // native compilation, we can rely on the configuration stuff @@ -127,6 +129,8 @@ CodeGen *codegen_create(Buf *root_src_path, const ZigTarget *target, OutType out g->libc_lib_dir = buf_create_from_str(ZIG_LIBC_LIB_DIR); g->libc_static_lib_dir = buf_create_from_str(ZIG_LIBC_STATIC_LIB_DIR); g->libc_include_dir = buf_create_from_str(ZIG_LIBC_INCLUDE_DIR); + g->msvc_lib_dir = nullptr; // find it at runtime + g->kernel32_lib_dir = nullptr; // find it at runtime #ifdef ZIG_EACH_LIB_RPATH g->each_lib_rpath = true; #endif @@ -228,6 +232,14 @@ void codegen_set_libc_include_dir(CodeGen *g, Buf *libc_include_dir) { g->libc_include_dir = libc_include_dir; } +void codegen_set_msvc_lib_dir(CodeGen *g, Buf *msvc_lib_dir) { + g->msvc_lib_dir = msvc_lib_dir; +} + +void codegen_set_kernel32_lib_dir(CodeGen *g, Buf *kernel32_lib_dir) { + g->kernel32_lib_dir = kernel32_lib_dir; +} + void codegen_set_dynamic_linker(CodeGen *g, Buf *dynamic_linker) { g->dynamic_linker = dynamic_linker; } -- cgit v1.2.3