Skip to content

Pkgconfig CMake compatibility & switch to pkgconf - #693

Merged
Ryzee119 merged 5 commits into
XboxDev:masterfrom
thrimbor:pkgconfig_changes
Jan 14, 2025
Merged

Pkgconfig CMake compatibility & switch to pkgconf#693
Ryzee119 merged 5 commits into
XboxDev:masterfrom
thrimbor:pkgconfig_changes

Conversation

@thrimbor

Copy link
Copy Markdown
Member

The last two commits are from #631, with only the commit title updated. They make it possible for CMake to find the libraries to link against via pkg-config.

These two commits had the problem that they fix CMake, but by doing so are breaking direct usage of nxdk-pkg-config (and probably meson) because the emitted linker arguments are in ld syntax, while we rely on the syntax of link.exe.

This PR circumvents this issue by switching from whatever pkg-config the host OS provides to explicitly requiring pkgconf (which is the default pkg-config implementation on Arch, Alpine and probably others anyway).
pkgconf provides a --msvc-syntax parameter that can be used to get the required link.exe-style linker parameters. This would add an additional .lib suffix to the library paths (resulting in things like libjpeg.lib.lib), so I added a small sed command to fix that.

Comment thread bin/nxdk-pkg-config
@Ryzee119

Copy link
Copy Markdown
Contributor

Thanks, I tested this on a couple of my cmake projects. After adding the new dependency on pkgconf, all worked as expected

@Ryzee119
Ryzee119 merged commit 6d3be63 into XboxDev:master Jan 14, 2025
@thrimbor
thrimbor deleted the pkgconfig_changes branch January 17, 2025 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants