aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-03-09 01:00:45 -0500
committerAndrew Kelley <andrew@ziglang.org>2019-03-09 01:00:45 -0500
commit94e52dba85e4b81f5c4f2576c91df039604d06fb (patch)
tree1f2dc6ff88128caa53d15518f8c4fddac5b27556 /src
parent5046aa9403e98fec7a744f35faa9d17925c9079d (diff)
downloadzig-94e52dba85e4b81f5c4f2576c91df039604d06fb.tar.gz
zig-94e52dba85e4b81f5c4f2576c91df039604d06fb.zip
fix docgen and fix unnecessarily adding .root suffix to objects
Diffstat (limited to 'src')
-rw-r--r--src/codegen.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 30b1c87662..719eead7f2 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -9120,18 +9120,14 @@ static void resolve_out_paths(CodeGen *g) {
buf_init_from_buf(&g->output_file_path, g->link_objects.at(0));
return;
}
- if (!need_llvm_module(g) || (g->enable_cache && g->link_objects.length == 0)) {
- // Either we're not creating an object file from our LLVM Module,
- // or we have caching enabled and do not need to link objects together.
- // In both cases, the output file path and object file path basename can match.
- buf_append_str(o_basename, target_o_file_ext(g->zig_target));
- buf_append_str(out_basename, target_o_file_ext(g->zig_target));
- } else {
+ if (need_llvm_module(g) && g->link_objects.length != 0 && !g->enable_cache &&
+ buf_eql_buf(o_basename, out_basename))
+ {
// make it not collide with main output object
buf_append_str(o_basename, ".root");
- buf_append_str(o_basename, target_o_file_ext(g->zig_target));
- buf_append_str(out_basename, target_o_file_ext(g->zig_target));
}
+ buf_append_str(o_basename, target_o_file_ext(g->zig_target));
+ buf_append_str(out_basename, target_o_file_ext(g->zig_target));
break;
case OutTypeExe:
buf_append_str(o_basename, target_o_file_ext(g->zig_target));