Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

jpakkane
Copy link
Member

@jpakkane jpakkane commented Sep 9, 2025

With this you can choose the library naming scheme regardless of the platform used.

A thing to decide before merging is whether we should keep the current scheme (.a on Windows) or switch to the platform default (.dll for libs and .dll.lib for import libs).

Copy link
Member

@eli-schwartz eli-schwartz left a comment

Choose a reason for hiding this comment

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

A thing to decide before merging is whether we should keep the current scheme (.a on Windows) or switch to the platform default (.dll for libs and .dll.lib for import libs).

This isn't the platform default at all, though? We're just making up our own new convention that nobody uses, aren't we? Isn't it .lib alone.

As far as I can tell this entire feature despite being cross platform basically exists solely to cater to windows users specifically. It should be a fatal error to set this property on Linux (or at least to change it from the default).

The purpose of setting it is really just to make users happy who insist that .a should mean mingw-gcc+ucrt while .lib should mean MSVC+ucrt. I'm not necessarily averse to making those users happy but it feels like a leaky abstraction if it affects other platforms too.

Making this change by default seems like it would break existing users who rely on the mingw linker search pattern support for detecting libraries by name rather than filepath (and which currently supports both lib*.a and *.lib, doesn't it?)

@jpakkane
Copy link
Member Author

jpakkane commented Sep 9, 2025

This isn't the platform default at all, though? We're just making up our own new convention that nobody uses, aren't we? Isn't it .lib alone.

This just copies the way rustc does it. Which is the most reasonable way of making it work in a cross platform way.

@jpakkane
Copy link
Member Author

jpakkane commented Sep 9, 2025

As far as I can tell this entire feature despite being cross platform basically exists solely to cater to windows users specifically.

Actually no, for example on macOS you might want to use .so instead of .dylib sometimes.

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.

2 participants