aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-02-02 15:04:14 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-02-02 15:04:14 -0700
commit7af59c76e40d185ed1a8962c2d5fd0f88680d5a7 (patch)
treefbd8eeaf799fbea424a546b0ae199ce91a7e70ad /src/codegen.cpp
parent5824b15249c8fb42aba5ca347d7dc702a4a00a9f (diff)
downloadzig-7af59c76e40d185ed1a8962c2d5fd0f88680d5a7.tar.gz
zig-7af59c76e40d185ed1a8962c2d5fd0f88680d5a7.zip
build: fix libc path finding
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp13
1 files changed, 10 insertions, 3 deletions
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);
}