commit a53becc034fc9447843286d140780e25d29c07d4 (tree)
parent 0fb26b03690eb327164bbc7a21ba2d69d3b1a5b8
Author: Matt Knight <mattnite@protonmail.com>
Date: Sun, 7 Nov 2021 10:28:25 -0800
don't invoke linker when just building an object
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/link.zig b/src/link.zig
@@ -474,6 +474,10 @@ pub const File = struct {
try fs.cwd().copyFile(cached_pp_file_path, fs.cwd(), full_out_path, .{});
return;
}
+
+ if (base.options.output_mode == .Obj)
+ return;
+
const use_lld = build_options.have_llvm and base.options.use_lld;
if (use_lld and base.options.output_mode == .Lib and base.options.link_mode == .Static) {
return base.linkAsArchive(comp);