Clang MSBuild toolset for Visual Studio 2017
This is a MSBuild toolset with LLVM Clang for Windows.
- Visual Studio 2017
- Clang for Windows Download from the LLVM website and install it, or use the snapshot. You can also use one of your builds.
First, download the latest release. Its host architecture must be the same to that of Clang for Windows.
Run install.bat, and set the LLVM path and a toolset name. Administrator authority is required for installation. To use with CMake, the toolset name must match v[0-9]+_clang_.*
.
Currently, there is no script provided and the installed toolsets can be removed manually.
dir $(VSInstallDir)\Common7\IDE\VC\VCTargets\Platforms\Win32\PlatformToolsets\
rmdir /s /q $(VSInstallDir)\Common7\IDE\VC\VCTargets\Platforms\Win32\PlatformToolsets\$(YourToolsetName)
rmdir /s /q $(VSInstallDir)\Common7\IDE\VC\VCTargets\Platforms\x64\PlatformToolsets\$(YourToolsetName)
where variable $(VSInstallDir)
denotes Visual Studio installation path and $(YourToolsetName)
is name of the installed clang toolset.
Open the project property, select [Configuration Properties -> General] in the left list, select [Platform toolset] in [General] group, and select the toolset name that you set during the installation (the default name is v100_clang_fafnir). Then you can build the project using LLVM clang.
When you run cmake command, specify "Visual Studio 15 2017"
or "Visual Studio 15 2017 Win64"
to the option -G
, specify the toolset name, that you set during the installation, to the option -T
.
The toolset installed by Fafnir is required to build Fafnir. Also, LLVM that supports C++17 must be used (e.g. the release binaries of Fafnir are built with the LLVM Snapshot Build). CMake is also required.
- Build 64bit version
cmake -G "Visual Studio 15 2017 Win64" -T <installed Fafnir toolset> -DCMAKE_INSTALL_PREFIX=<path to install>
cmake --build . --config Release --target INSTALL
- Build 32bit version
cmake -G "Visual Studio 15 2017" -T <installed Fafnir toolset> -DCMAKE_INSTALL_PREFIX=<path to install>
cmake --build . --config Release --target INSTALL
Run the above commands, and then you will find deployed files in the install path.