diff options
| author | Matt Knight <mattnite@protonmail.com> | 2021-11-07 10:28:25 -0800 |
|---|---|---|
| committer | Matt Knight <mattnite@protonmail.com> | 2021-11-07 10:28:25 -0800 |
| commit | a53becc034fc9447843286d140780e25d29c07d4 (patch) | |
| tree | f5d062e5bd773c65fc402aae98fb330d57af23c9 /src/link.zig | |
| parent | 0fb26b03690eb327164bbc7a21ba2d69d3b1a5b8 (diff) | |
| download | zig-a53becc034fc9447843286d140780e25d29c07d4.tar.gz zig-a53becc034fc9447843286d140780e25d29c07d4.zip | |
don't invoke linker when just building an object
Diffstat (limited to 'src/link.zig')
| -rw-r--r-- | src/link.zig | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/link.zig b/src/link.zig index 762c6f9212..66330ae9b0 100644 --- 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); |
