diff options
Diffstat (limited to 'utils/release/build_llvm_package.bat')
-rwxr-xr-x | utils/release/build_llvm_package.bat | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/utils/release/build_llvm_package.bat b/utils/release/build_llvm_package.bat index bb6853f57c6fd..eca74347cf3e7 100755 --- a/utils/release/build_llvm_package.bat +++ b/utils/release/build_llvm_package.bat @@ -8,9 +8,9 @@ REM Usage: build_llvm_package.bat <revision> REM Prerequisites:
REM
-REM Visual Studio 2015, CMake, Ninja, SVN, GNUWin32, SWIG, Python 3,
+REM Visual Studio 2017, CMake, Ninja, SVN, GNUWin32, SWIG, Python 3,
REM NSIS with the strlen_8192 patch,
-REM Visual Studio 2015 SDK (for the clang-format plugin).
+REM Visual Studio 2017 SDK (for the clang-format plugin).
REM
REM
REM For LLDB, SWIG version <= 3.0.8 needs to be used to work around
@@ -18,15 +18,16 @@ REM https://github.com/swig/swig/issues/769 REM You need to modify the paths below:
-set vcdir=c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
+set vsdevcmd=C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\VsDevCmd.bat
+
set python32_dir=C:\Users\hwennborg\AppData\Local\Programs\Python\Python35-32
set python64_dir=C:\Users\hwennborg\AppData\Local\Programs\Python\Python35
set PATH=%PATH%;c:\gnuwin32\bin
set revision=%1
set branch=trunk
-set package_version=4.0.0-r%revision%
-set clang_format_vs_version=4.0.0.%revision%
+set package_version=5.0.0-r%revision%
+set clang_format_vs_version=5.0.0.%revision%
set build_dir=llvm_package_%revision%
echo Branch: %branch%
@@ -47,14 +48,15 @@ svn.exe export -r %revision% http://llvm.org/svn/llvm-project/clang-tools-extra/ svn.exe export -r %revision% http://llvm.org/svn/llvm-project/lld/%branch% llvm/tools/lld || exit /b
svn.exe export -r %revision% http://llvm.org/svn/llvm-project/compiler-rt/%branch% llvm/projects/compiler-rt || exit /b
svn.exe export -r %revision% http://llvm.org/svn/llvm-project/openmp/%branch% llvm/projects/openmp || exit /b
+svn.exe export -r %revision% http://llvm.org/svn/llvm-project/lldb/%branch% llvm/tools/lldb || exit /b
REM Setting CMAKE_CL_SHOWINCLUDES_PREFIX to work around PR27226.
-set cmake_flags=-DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON -DLLVM_USE_CRT_RELEASE=MT -DCLANG_FORMAT_VS_VERSION=%clang_format_vs_version% -DPACKAGE_VERSION=%package_version% -DLLDB_RELOCATABLE_PYTHON=1 -DLLDB_TEST_COMPILER=%cd%\build32_stage0\bin\clang.exe -DCMAKE_CL_SHOWINCLUDES_PREFIX="Note: including file: "
+set cmake_flags=-DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON -DCMAKE_INSTALL_UCRT_LIBRARIES=ON -DCLANG_FORMAT_VS_VERSION=%clang_format_vs_version% -DPACKAGE_VERSION=%package_version% -DLLDB_RELOCATABLE_PYTHON=1 -DLLDB_TEST_COMPILER=%cd%\build32_stage0\bin\clang.exe -DCMAKE_CL_SHOWINCLUDES_PREFIX="Note: including file: "
REM TODO: Run all tests, including lld and compiler-rt.
-call "%vcdir%/vcvarsall.bat" x86
+call "%vsdevcmd%" -arch=x86
set CC=
set CXX=
mkdir build32_stage0
@@ -69,16 +71,25 @@ mkdir build32 cd build32
set CC=..\build32_stage0\bin\clang-cl
set CXX=..\build32_stage0\bin\clang-cl
-cmake -GNinja %cmake_flags% -DBUILD_CLANG_FORMAT_VS_PLUGIN=ON -DPYTHON_HOME=%python32_dir% ..\llvm || exit /b
+cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python32_dir% ..\llvm || exit /b
ninja all || exit /b
ninja check || ninja check || ninja check || exit /b
ninja check-clang || ninja check-clang || ninja check-clang || exit /b
-copy ..\llvm\tools\clang\tools\clang-format-vs\ClangFormat\bin\Release\ClangFormat.vsix ClangFormat-r%revision%.vsix
ninja package || exit /b
cd ..
+REM The plug-in is built separately as it uses a statically linked clang-format.exe.
+mkdir build_vsix
+cd build_vsix
+set CC=..\build32_stage0\bin\clang-cl
+set CXX=..\build32_stage0\bin\clang-cl
+cmake -GNinja %cmake_flags% -DLLVM_USE_CRT_RELEASE=MT -DBUILD_CLANG_FORMAT_VS_PLUGIN=ON -DPYTHON_HOME=%python32_dir% ..\llvm || exit /b
+ninja clang_format_vsix || exit /b
+copy ..\llvm\tools\clang\tools\clang-format-vs\ClangFormat\bin\Release\ClangFormat.vsix ClangFormat-r%revision%.vsix
+cd ..
+
-call "%vcdir%/vcvarsall.bat" amd64
+call "%vsdevcmd%" -arch=amd64
set CC=
set CXX=
mkdir build64_stage0
|