Commit a53becc034

Matt Knight <mattnite@protonmail.com>
2021-11-07 19:28:25
don't invoke linker when just building an object
1 parent 0fb26b0
Changed files (1)
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);