implement standard library path search

closes #463
See #302
This commit is contained in:
Andrew Kelley
2017-10-01 18:29:50 -04:00
parent 9636603a3b
commit 1962c8588f
10 changed files with 147 additions and 32 deletions

View File

@@ -56,13 +56,20 @@ static PackageTableEntry *new_package(const char *root_src_dir, const char *root
}
CodeGen *codegen_create(Buf *root_src_path, const ZigTarget *target, OutType out_type, BuildMode build_mode,
Buf *zig_std_dir)
Buf *zig_lib_dir)
{
CodeGen *g = allocate<CodeGen>(1);
codegen_add_time_event(g, "Initialize");
g->zig_std_dir = zig_std_dir;
g->zig_lib_dir = zig_lib_dir;
g->zig_std_dir = buf_alloc();
os_path_join(zig_lib_dir, buf_create_from_str("std"), g->zig_std_dir);
g->zig_c_headers_dir = buf_alloc();
os_path_join(zig_lib_dir, buf_create_from_str("include"), g->zig_c_headers_dir);
g->build_mode = build_mode;
g->out_type = out_type;
g->import_table.init(32);