-
-
Notifications
You must be signed in to change notification settings - Fork 613
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: Enable using clang-cl on windows #1651
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I haven't tested (Windows isn't my main dev environment), but the code seems OK from a quick skimming, and CI is passing :-)
I've also fixed the commit message like asked. |
This one will need a rebase - there's a conflict after having merged a few of your other PRs |
d8eeba2
to
9b7b073
Compare
@enetheru this is exactly what I needed, perfect timing haha 💖. Thank you! I do get the following warning for every file:
common_compiler_flags.cmake:78
31 because my 32 threads Ryzen -1 |
Thanks for the catch, looks like clang-cl doesnt care about that flag where MSVC does. I will account for it before I take the PR out of draft. Cheers. |
76acc44
to
3b13aac
Compare
Rebased ontop of #1648 |
e19bba4
to
59574ab
Compare
detect clang with MSVC frontend using CMAKE_CXX_COMPILER_FRONTEND_VARIANT
Thanks! |
As listed here: #1250
clang-cl on windows installed from official llvm website fails because it emulates the msvc interface.
Prior solution assumed that because compiler is clang it uses gnu interface.
CMake offers some helper variables to account for this simulation/emulation of other compilers like:
CMAKE_CXX_COMPILER_FRONTEND_VARIANT
This PR detects the difference and sets the helper variables to match what is in use.
It isn't robust enough to mix and match compiler and linker interfaces though, so using a gnu style linker with an msvc style compiler will fail.
I've tested this on windows and mac, with windows based compilers msvc, msys-gcc msys-clang, llvm, mingw64, without issue.
Fixes #1250