diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-07-13 09:48:39 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-13 09:48:39 -0700 |
| commit | f2d433a19375734d744656c1c231525aab6ee59f (patch) | |
| tree | 8eb0335aa1fdccf1c051c880c32d38c5bf251fce /lib/std/Build | |
| parent | 2896266a038cde4b64743534df7ccdd3f5b9347f (diff) | |
| parent | cea8645423604b758208d94ff4d404a0fbae51f8 (diff) | |
| download | zig-f2d433a19375734d744656c1c231525aab6ee59f.tar.gz zig-f2d433a19375734d744656c1c231525aab6ee59f.zip | |
Merge pull request #15708 from xxxbxxx/build-link
build: avoid repeating objects when linking a static library
Diffstat (limited to 'lib/std/Build')
| -rw-r--r-- | lib/std/Build/Step/Compile.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/std/Build/Step/Compile.zig b/lib/std/Build/Step/Compile.zig index 7ca8748dbf..c83f72328c 100644 --- a/lib/std/Build/Step/Compile.zig +++ b/lib/std/Build/Step/Compile.zig @@ -2192,7 +2192,8 @@ const TransitiveDeps = struct { if ((try td.seen_steps.fetchPut(&inner_other.step, {})) != null) continue; - if (!dyn) + const included_in_lib = (other.kind == .lib and inner_other.kind == .obj); + if (!dyn and !included_in_lib) try td.link_objects.append(other_link_object); try addInner(td, inner_other, dyn or inner_other.isDynamicLibrary()); |
