build: never use pkg-config to link system libraries #217

Merged
ifreund merged 1 commit from say-no-to-pkg-config into main 2022-04-12 19:08:30 +00:00
ifreund commented 2022-04-12 18:19:00 +00:00 (Migrated from github.com)

Every library we want to link against is either provided by the Zig
toolchain or part of our SDK. Therefore, using pkg-config to link
against libraries on the host system is never what we intend.

To fix this, use linkSystemLibraryName() everywhere instead of
linkSystemLibrary() as the latter integrates with pkg-config while the
former just passes -lfoo to the zig compiler.

In combination with Zig commit 38d6e1d8a8 fixing an std.build bug,
this change fixes the linking of the necessary X11 libraries on my
x86_64 glibc based Void Linux system.

  • By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.
Every library we want to link against is either provided by the Zig toolchain or part of our SDK. Therefore, using pkg-config to link against libraries on the host system is never what we intend. To fix this, use linkSystemLibraryName() everywhere instead of linkSystemLibrary() as the latter integrates with pkg-config while the former just passes -lfoo to the zig compiler. In combination with Zig commit 38d6e1d8a8 fixing an std.build bug, this change fixes the linking of the necessary X11 libraries on my x86_64 glibc based Void Linux system. - [x] By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
hexops/mach!217
No description provided.