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

Fix Windows static library detection and usage #154

Merged
merged 3 commits into from Jan 17, 2024

Conversation

amyspark
Copy link
Contributor

Hi!

This PR is intended to address some issues found when attempting to link to static libraries under Windows.

  • -Wl,--undefined flags were silently skipped.
  • is_static_available does not consider Windows SDK or CRT bindings.
  • Allows using the .a and .dll.a convention for MSVC as well, thus letting Meson-built libraries be used.

CC @nirbheek

Although there's a clear MSVC convention of calling import libraries
"xxxx.lib", when a build system creates both static and shared
libraries, a race condition will be caused [1].

To this end, the Meson build system decided to also apply the GNU
convention for the MSVC ABI [2], which is not considered in
pkg-config-rs.

[1]: https://aomedia-review.googlesource.com/c/aom/+/173603
[2]: mesonbuild/meson#8153
@amyspark amyspark force-pushed the fix-windows-library-detection branch 2 times, most recently from e635f4c to 7c30de6 Compare January 16, 2024 16:42
src/lib.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@sdroege sdroege left a comment

Choose a reason for hiding this comment

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

Seems good to me otherwise

@amyspark amyspark force-pushed the fix-windows-library-detection branch from 7c30de6 to aafa1b2 Compare January 16, 2024 17:23
@sdroege sdroege merged commit ed9ef8e into rust-lang:master Jan 17, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants