How to compile vcpkg libraries using Clang? #38030
Replies: 2 comments
-
I think your question was answer in #38042. |
Beta Was this translation helpful? Give feedback.
-
The documentation is not at all clear about this and it is a roundabout solution as well, but I finally got this to work today. The solution comes in three parts:
Note to avoid circular loading of the toolchain for use both in the main project and vcpkg, I needed to indirectly load the build system CMake file with
This ensures the compilation is done with clang and clang++ for the local project and sets up vcpkg.cmake as per usual.
For the vcpkg team: both documentation improvements and a look at liburing compilation failing under clang at the link stage -- it complains about being unable to reference |
Beta Was this translation helpful? Give feedback.
-
Dear vcpkg team,
I am currently using vcpkg to manage dependencies for my project, and I must say it is an incredibly useful tool that has greatly enhanced my productivity. However, I have encountered an issue with compiler compatibility that I hope you can assist me with.
Issue Description:
My project requires compilation with the Clang compiler due to bugs I have encountered with MSVC, which prevent successful compilation. When I switch to using Clang, the compilation proceeds without issues. This has led me to conclude that the bugs are indeed with MSVC.
The problem arises when I attempt to link my project. Since my project is compiled with Clang, and the libraries installed via vcpkg are compiled with MSVC by default, I am experiencing ABI incompatibility issues.
My question is: Is there a way to configure vcpkg to use the Clang compiler for building libraries? This would ensure that both my project and the dependencies are compiled with the same compiler, thus avoiding ABI compatibility issues.
If this is not currently a supported feature, I would like to suggest considering adding support for the Clang compiler. This would make vcpkg more versatile and accommodating to a wider range of project requirements.
Thank you very much for your time and assistance!
Feel free to modify and expand on this draft based on your specific situation. Good luck with your issue!
Beta Was this translation helpful? Give feedback.
All reactions