aboutsummaryrefslogtreecommitdiff
path: root/src/link.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-03-26 06:39:28 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-03-26 06:39:28 -0400
commit5bc9feb5cb98fc13db62d01b2b9fec15677310a7 (patch)
tree12972dfc1f9b964bb74428ec0d6766e77b9b0be7 /src/link.cpp
parent7ce753a16b0c16b4c6494467f42f2d5fe9a235e6 (diff)
downloadzig-5bc9feb5cb98fc13db62d01b2b9fec15677310a7.tar.gz
zig-5bc9feb5cb98fc13db62d01b2b9fec15677310a7.zip
organize std and make import relative to current file
closes #216
Diffstat (limited to 'src/link.cpp')
-rw-r--r--src/link.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/link.cpp b/src/link.cpp
index d0af76a47d..faf9fd26e0 100644
--- a/src/link.cpp
+++ b/src/link.cpp
@@ -42,10 +42,9 @@ static const char *get_o_file_extension(CodeGen *g) {
static Buf *build_o(CodeGen *parent_gen, const char *oname) {
Buf *source_basename = buf_sprintf("%s.zig", oname);
- Buf *std_dir_path = parent_gen->zig_std_dir;
ZigTarget *child_target = parent_gen->is_native_target ? nullptr : &parent_gen->zig_target;
- CodeGen *child_gen = codegen_create(std_dir_path, child_target);
+ CodeGen *child_gen = codegen_create(parent_gen->zig_std_special_dir, child_target);
child_gen->link_libc = parent_gen->link_libc;
child_gen->link_libs.resize(parent_gen->link_libs.length);
@@ -70,13 +69,14 @@ static Buf *build_o(CodeGen *parent_gen, const char *oname) {
codegen_set_mios_version_min(child_gen, parent_gen->mios_version_min);
Buf *full_path = buf_alloc();
- os_path_join(std_dir_path, source_basename, full_path);
+ os_path_join(parent_gen->zig_std_special_dir, source_basename, full_path);
+
Buf source_code = BUF_INIT;
if (os_fetch_file_path(full_path, &source_code)) {
zig_panic("unable to fetch file: %s\n", buf_ptr(full_path));
}
- codegen_add_root_code(child_gen, std_dir_path, source_basename, &source_code);
+ codegen_add_root_code(child_gen, parent_gen->zig_std_special_dir, source_basename, &source_code);
const char *o_ext = get_o_file_extension(child_gen);
Buf *o_out = buf_sprintf("%s%s", oname, o_ext);
codegen_link(child_gen, buf_ptr(o_out));