cd build32\r
set CC=..\build32_stage0\bin\clang-cl\r
set CXX=..\build32_stage0\bin\clang-cl\r
-cmake -GNinja %cmake_flags% -DBUILD_CLANG_FORMAT_VS_PLUGIN=ON -DPYTHON_HOME=%python32_dir% ..\llvm || exit /b\r
+cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python32_dir% ..\llvm || exit /b\r
ninja all || exit /b\r
ninja check || ninja check || ninja check || exit /b\r
ninja check-clang || ninja check-clang || ninja check-clang || exit /b\r
ninja package || exit /b\r
cd ..\r
\r
+REM The plug-in is built separately as it uses a statically linked clang-cl.exe.\r
+mkdir build_vsix\r
+cd build_vsix\r
+set CC=..\build32_stage0\bin\clang-cl\r
+set CXX=..\build32_stage0\bin\clang-cl\r
+cmake -GNinja %cmake_flags% -DLLVM_USE_CRT_RELEASE=MT -DBUILD_CLANG_FORMAT_VS_PLUGIN=ON -DPYTHON_HOME=%python32_dir% ..\llvm || exit /b\r
+ninja clang_format_vsix || exit /b\r
+copy ..\llvm\tools\clang\tools\clang-format-vs\ClangFormat\bin\Release\ClangFormat.vsix ClangFormat-r%revision%.vsix\r
+cd ..\r
+\r
\r
call "%vcdir%/vcvarsall.bat" amd64\r
set CC=\r