Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pkgconfig CMake compatibility & switch to pkgconf #693

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

thrimbor
Copy link
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.

--define-variable=NXDK_DIR=${NXDK_DIR} \
--define-prefix \
--static \
"$@"
"$@" | sed 's/\.lib\.lib/\.lib/g'
Copy link
Member

@JayFoxRox JayFoxRox Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I follow the PR description.

I thought the .lib.lib only happens when using --msvc-syntax, but now --msvc-syntax is absent?
(Also, why does it produce .lib.lib? This feels like a bug - was it reported?)

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.

3 participants