aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/llvm.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-01-03 16:50:29 -0500
committerGitHub <noreply@github.com>2022-01-03 16:50:29 -0500
commit81fa31c05456facea1d1963a1e7f665351fb248d (patch)
tree8ea6dba0c5b8ec9e8ba9cdff48189da68c198dfd /src/codegen/llvm.zig
parent850b053ea6b7d6f0f5e0e8dbcf37080ca012024f (diff)
parentd94303be2bcee33e7efba22a186fd06eaa809707 (diff)
downloadzig-81fa31c05456facea1d1963a1e7f665351fb248d.tar.gz
zig-81fa31c05456facea1d1963a1e7f665351fb248d.zip
Merge pull request #10451 from ziglang/cache-mode
stage2: introduce CacheMode
Diffstat (limited to 'src/codegen/llvm.zig')
-rw-r--r--src/codegen/llvm.zig10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig
index a248fb1718..e29116476d 100644
--- a/src/codegen/llvm.zig
+++ b/src/codegen/llvm.zig
@@ -324,10 +324,12 @@ pub const Object = struct {
const mod = comp.bin_file.options.module.?;
const cache_dir = mod.zig_cache_artifact_directory;
- const emit_bin_path: ?[*:0]const u8 = if (comp.bin_file.options.emit) |emit|
- try emit.directory.joinZ(arena, &[_][]const u8{self.sub_path})
- else
- null;
+ const emit_bin_path: ?[*:0]const u8 = if (comp.bin_file.options.emit) |emit| blk: {
+ const full_out_path = try emit.directory.join(arena, &[_][]const u8{emit.sub_path});
+ break :blk try std.fs.path.joinZ(arena, &.{
+ std.fs.path.dirname(full_out_path).?, self.sub_path,
+ });
+ } else null;
const emit_asm_path = try locPath(arena, comp.emit_asm, cache_dir);
const emit_llvm_ir_path = try locPath(arena, comp.emit_llvm_ir, cache_dir);