build_llvm_package.bat: Build teh clang-format plugin separately
authorHans Wennborg <hans@hanshq.net>
Wed, 8 Feb 2017 20:58:33 +0000 (20:58 +0000)
committerHans Wennborg <hans@hanshq.net>
Wed, 8 Feb 2017 20:58:33 +0000 (20:58 +0000)
In r293373 we switched the build to linking dynamically against the
Universal CRT and include the redistributables in the installer.

However, clang-format.exe is copied into the vsix and needs to be
statically linked. This commit makes us build the plugin in a separate
step that uses static linking.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294513 91177308-0d34-0410-b5e6-96231b3b80d8

utils/release/build_llvm_package.bat

index da968c84a8ba970da66667ff1564696bac05aec0..5e3f2ae6e5479e2986c15a279d2df65f9fe44427 100755 (executable)
@@ -70,7 +70,7 @@ mkdir build32
 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
@@ -78,6 +78,16 @@ copy ..\llvm\tools\clang\tools\clang-format-vs\ClangFormat\bin\Release\ClangForm
 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