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

CMake: depend on libc++ when compiling with Clang #170

Closed
wants to merge 1 commit into from

Conversation

robUx4
Copy link

@robUx4 robUx4 commented Jan 10, 2025

libstdc++ is a GCC thing.

Issue

When compiling with llvm-mingw the .pc file references -lstdc++ which doesn't exist as it's a GCC thing.

Solution

CMake can tell which compiler is used.

Rather than hardcoding thing it might be better to just use CMAKE_CXX_IMPLICIT_LINK_LIBRARIES: https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_IMPLICIT_LINK_LIBRARIES.html

@mav-intel
Copy link
Contributor

Hi @robUx4 Thanks for identifying this issue! A more general solution seems to be to rely on the compiler or CMake to include the library by default instead of calling it out explicitly. This approach is implemented in 80ea0a5

@mav-intel mav-intel closed this Jan 17, 2025
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