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

FindKLU.cmake: Avoid detecting MSVC libraries when targeting MinGW #476

Merged
merged 2 commits into from
May 15, 2024

Conversation

mmuetzel
Copy link
Contributor

@mmuetzel mmuetzel commented May 15, 2024

For MinGW, setting the library prefix is not necessary and setting the library suffix to d.lib is incorrect. The static library suffix is .a for MinGW.

Prepending those values to the list of library prefixes and suffixes might not actually cause an issue if no libraries are found that match those patterns. But slight ABI differences between MSVC and MinGW could lead to unexpected behavior when mixing binaries of both targets.

This was already discussed in #407 (comment). But apparently that change got lost in one of the rebases in that PR.

For MinGW, setting the library prefix is not necessary and setting the
library suffix to d.lib is incorrect. The static library suffix is .a for
MinGW.

Prepending those values to the list of library prefixes and suffixes
might not actually cause an issue if no libraries are found that match
those patterns. But slight ABI differences between MSVC and MinGW could
lead to unexpected behavior when mixing binaries of both targets.

Signed-off-by: Markus Mützel <markus.muetzel@gmx.de>
Only override `CMAKE_FIND_LIBRARY_PREFIXES` for MSVC. Don't do that for
any MinGW target (not just for an MSYS toolchain).

Signed-off-by: Markus Mützel <markus.muetzel@gmx.de>
@balos1 balos1 added this to the SUNDIALS Next milestone May 15, 2024
@balos1 balos1 merged commit d0ed8b3 into LLNL:develop May 15, 2024
18 checks passed
gardner48 pushed a commit that referenced this pull request Jun 20, 2024
)

For MinGW, setting the library prefix is not necessary and setting the
library suffix to d.lib is incorrect. The static library suffix is .a
for MinGW.

Prepending those values to the list of library prefixes and suffixes
might not actually cause an issue if no libraries are found that match
those patterns. But slight ABI differences between MSVC and MinGW could
lead to unexpected behavior when mixing binaries of both targets.

This was already discussed in
#407 (comment). But
apparently that change got lost in one of the rebases in that PR.

---------

Signed-off-by: Markus Mützel <markus.muetzel@gmx.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants