diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-10-01 18:29:50 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-10-01 18:30:31 -0400 |
| commit | 1962c8588f03f510c100d318472505315acaf3b2 (patch) | |
| tree | 0a75534a8915522f0817db4ddbedc60c10c5f081 /src/codegen.cpp | |
| parent | 9636603a3b14bd7205f762f8abb096d9f0ad1ec5 (diff) | |
| download | zig-1962c8588f03f510c100d318472505315acaf3b2.tar.gz zig-1962c8588f03f510c100d318472505315acaf3b2.zip | |
implement standard library path search
closes #463
See #302
Diffstat (limited to 'src/codegen.cpp')
| -rw-r--r-- | src/codegen.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp index e31b318dcc..f0826e3c49 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -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); |
