# std.build: Fix transitive linkSystemLibraryName\(\) dependencies · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/38d6e1d8a85ff77bc98dd80f604525e0804dec11)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 38d6e1d8a85ff77bc98dd80f604525e0804dec11

Requested commit: 38d6e1d8a85ff77bc98dd80f604525e0804dec11

Commit: 38d6e1d8a85ff77bc98dd80f604525e0804dec11

Tree: 7244813c9400376f8efc71c8011f89b4683a08a0

Author: Isaac Freund

Committer: Andrew Kelley

## Message

```
std.build: Fix transitive linkSystemLibraryName() dependencies

Currently transitive system library dependencies are always linked using
linkSystemLibrary() and therefore pkg-config even if they were
originally specified with linkSystemLibraryName() instead. This causes
problems in practice for projects needing total control over exactly
what library is linked, such as the mach game engine.

This is fixed by keeping track of whether libraries are to be linked
with pkg-config or not and holding off on actually running pkg-config
until after transitive dependency resolution in LibExeObjStep.make().

This also fixes a separate issue with the pkg-config handling that could
cause partial application of pkg-config flags if the first part of the
pkg-config output parses correctly but there is an error later on. This
error isn't always fatal as we fall back to a plain -lfoo in the case of
linkSystemLibrary().

```

## Parents

- [b9d86c6bc8e5d475ed8613bb241d1520377e629c](https://git.cafe/gitcafe/zig/commit/b9d86c6bc8e5d475ed8613bb241d1520377e629c?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/38d6e1d8a85ff77bc98dd80f604525e0804dec11?format=markdown)
