Search code examples
visual-studiomsbuildvisual-studio-2017llvmllvm-clang

Integrate LLVM Clang 4.x.x / 5.x.x / 6.x.x into Visual Studio 2017


The official LLVM 4.0 build for Windows integrates with Visual Studio up to Visual Studio 2015. Unfortunately it still doesn't support Visual Studio 2017.

When you try to set the Platform Toolset of a project to LLVM-vs2014, it pops up an error.

Do you know any way to make it work?


Update

In 2018, LLVM 6.0 officially still doesn't support integration with Visual Studio 2017 (version 15.X.X), only with the Visual Studio 2015 (version 14.X.X) toolset.


Solution

  • Finally, I found a brilliant GitHub repo with the required MSBuild platform toolsets which integrates LLVM clang 5.0.0 into Visual Studio 2017. After following the instructions of the README file, you will have two new platform toolsets LLVM-vs2017 and LLVM-vs2017_xp. Problem solved.

    Update

    I made a fork which is updated for LLVM 6.0.0 and provides better integration by providing include and library paths of LLVM/clang.

    Thanks to Royi, who realized that the original .prop files are explicitly tailored for LLVM 5.0 and it misses adding the proper lib ( $(LLVMInstallDir)\lib) and include ($(LLVMInstallDir)\lib\clang\6.0.0\include) folders.