From 7af59c76e40d185ed1a8962c2d5fd0f88680d5a7 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 2 Feb 2016 15:04:14 -0700 Subject: build: fix libc path finding --- src/codegen.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/codegen.cpp') diff --git a/src/codegen.cpp b/src/codegen.cpp index ecdc249443..c68632100a 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -33,6 +33,9 @@ CodeGen *codegen_create(Buf *root_source_dir) { g->next_error_index = 1; g->error_value_count = 1; + g->libc_lib_dir = buf_create_from_str(ZIG_LIBC_LIB_DIR); + g->libc_include_dir = buf_create_from_str(ZIG_LIBC_INCLUDE_DIR); + return g; } @@ -69,8 +72,12 @@ void codegen_set_out_name(CodeGen *g, Buf *out_name) { g->root_out_name = out_name; } -void codegen_set_libc_path(CodeGen *g, Buf *libc_path) { - g->libc_path = libc_path; +void codegen_set_libc_lib_dir(CodeGen *g, Buf *libc_lib_dir) { + g->libc_lib_dir = libc_lib_dir; +} + +void codegen_set_libc_include_dir(CodeGen *g, Buf *libc_include_dir) { + g->libc_include_dir = libc_include_dir; } void codegen_add_lib_dir(CodeGen *g, const char *dir) { @@ -3710,7 +3717,7 @@ static void generate_h_file(CodeGen *g) { static const char *get_libc_file(CodeGen *g, const char *file) { Buf *out_buf = buf_alloc(); - os_path_join(g->libc_lib_path, buf_create_from_str(file), out_buf); + os_path_join(g->libc_lib_dir, buf_create_from_str(file), out_buf); return buf_ptr(out_buf); } -- cgit v1.2.3