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
[bug] the wrong command line argument -stdlib=libstdc++
#9434
Comments
Improving clang support in Windows is an open issue: #9295 It is not simple to change this, because it also depends on the build system integration, and there are risks of breaking things, so I would say to try to implement and fix this in the new |
@arttet This is because clang-cl does not support /MP. You should remove -Werror from the gtest recipe. @memsharded The linked issue is about using standalone clang on windows not clang-cl, I think. |
By the way, I cannot reproduce the errors locally. Perhaps try to update VS/CMake first and get the new versions of recipes (conan install . --install-folder build --build --update ...). |
I was surprised because I cannot reproduce the errors locally too. However, I repeated it on GitHub. So I prepared the branch with my changes. I noticed the difference between the local build and the GitHub build. I use VS 16.11 and Clang 12.0.0 with MSVC-like command-line. GitHub uses VS 16.10.2+857e5a733 and Clang 11.0.0 with MSVC-like command-line. Anyway, I repeated a similar bug using Clang locally.
|
Try to change In your CMakeLists.txt
to
|
I applied your patch, but the result remained the same.
|
It also looks like the GNU style arguments are passed to clang-cl. I will have a look at this later.
Not sure but that seems to be fixed in clang 12. |
Case 1: Ok. clang_cl + cmake + visual studio generator Case 2: Failed. clang + cmake + ninja generator On my machine I got
too. |
Could you please use another branch such as |
I think case 2 should be valid. We can download Clang on Windows. Therefore, I think we need to be able to compile code with it. |
You can use my main branch, it works. Please check the changes. |
I would like to say your branch compiles nothing. Therefore, it works well. |
However, I can see the warning in your build.
|
I know but we have only ever used clang-cl for our real-life projects. Maybe just try to compile a simple test program without Conan? |
Yes, CMake VS generator or Conan pass the /MP option to clang-cl, VS do not. See CMakeLists.txt for workaround
But with new clang_cl version this is not necessary any more. |
I am sorry. I don’t get it. Anyway, I consider Clang as a competitor of MSVC. Clang has some advantages. Moreover, I hope Conan will help to use Clang. |
clang_cl is clang too. :-) Clang on Windows uses Visual Studio's linker and SDK, so you still need to have Visual Studio installed. And as long as that is the case, it is much easier to use clang_cl. |
Case 1 was fixed here. |
This is of course a clean solution. |
I am adding some tests for Clang into our test suite for new toolchains here: #9477 |
Hi @memsharded, @dmn-star Could you please update the status of this issue? |
-stdlib=libstdc++
There is the wrong command line argument
-stdlib=libstdc++
.Environment Details (include every applicable attribute)
Visual Studio 16 ClangCl
orClang 13
Steps to reproduce (Include if Applicable)
conan install . --install-folder build --build=outdated -s build_type=Debug -s compiler.cppstd=17 -s compiler.version=16 -s compiler="Visual Studio" -s compiler.toolset=ClangCL -e CC=clang-cl -e CXX=clang-cl
The text was updated successfully, but these errors were encountered: