aboutsummaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-10-04 18:00:21 -0400
committerGitHub <noreply@github.com>2020-10-04 18:00:21 -0400
commit302a69f127ae8542f49d9cd07c7cc49f3bbd6181 (patch)
tree063f062e7701e4679a0e97ad1a25021294663640 /src/main.zig
parent0e2d858d69ee1595bb58d936f83f0e0248d54d68 (diff)
parent6d3858dc8a5e5d510a6c9cc972357dda551628b3 (diff)
downloadzig-302a69f127ae8542f49d9cd07c7cc49f3bbd6181.tar.gz
zig-302a69f127ae8542f49d9cd07c7cc49f3bbd6181.zip
Merge pull request #6295 from Vexu/stage2
Stage2: basic imports
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main.zig b/src/main.zig
index 0868839257..4fddf9ed21 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -1454,6 +1454,11 @@ fn buildOutputType(
cleanup_root_dir = dir;
root_pkg_memory.root_src_directory = .{ .path = p, .handle = dir };
root_pkg_memory.root_src_path = try fs.path.relative(arena, p, src_path);
+ } else if (fs.path.dirname(src_path)) |p| {
+ const dir = try fs.cwd().openDir(p, .{});
+ cleanup_root_dir = dir;
+ root_pkg_memory.root_src_directory = .{ .path = p, .handle = dir };
+ root_pkg_memory.root_src_path = fs.path.basename(src_path);
} else {
root_pkg_memory.root_src_directory = .{ .path = null, .handle = fs.cwd() };
root_pkg_memory.root_src_path = src_path;