2015-12-11 08:43:42 +08:00
|
|
|
@echo off
|
|
|
|
setlocal
|
|
|
|
|
|
|
|
REM Script for building the LLVM installer on Windows,
|
|
|
|
REM used for the the weekly snapshots at http://www.llvm.org/builds.
|
|
|
|
REM
|
|
|
|
REM Usage: build_llvm_package.bat <revision>
|
|
|
|
|
|
|
|
REM Prerequisites:
|
|
|
|
REM
|
2016-09-16 07:01:03 +08:00
|
|
|
REM Visual Studio 2015, CMake, Ninja, SVN, GNUWin32, SWIG, Python 3,
|
2015-12-11 08:43:42 +08:00
|
|
|
REM NSIS with the strlen_8192 patch,
|
2016-09-16 07:01:03 +08:00
|
|
|
REM Visual Studio 2015 SDK (for the clang-format plugin).
|
2017-01-12 00:42:31 +08:00
|
|
|
REM
|
|
|
|
REM
|
|
|
|
REM For LLDB, SWIG version <= 3.0.8 needs to be used to work around
|
|
|
|
REM https://github.com/swig/swig/issues/769
|
2015-12-11 08:43:42 +08:00
|
|
|
|
|
|
|
|
2016-09-16 07:01:03 +08:00
|
|
|
REM You need to modify the paths below:
|
|
|
|
set vcdir=c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
|
|
|
|
set python32_dir=C:\Users\hwennborg\AppData\Local\Programs\Python\Python35-32
|
|
|
|
set python64_dir=C:\Users\hwennborg\AppData\Local\Programs\Python\Python35
|
2015-12-11 08:43:42 +08:00
|
|
|
set PATH=%PATH%;c:\gnuwin32\bin
|
|
|
|
|
|
|
|
set revision=%1
|
|
|
|
set branch=trunk
|
2017-01-13 05:22:36 +08:00
|
|
|
set package_version=5.0.0-r%revision%
|
|
|
|
set clang_format_vs_version=5.0.0.%revision%
|
2015-12-11 08:43:42 +08:00
|
|
|
set build_dir=llvm_package_%revision%
|
|
|
|
|
|
|
|
echo Branch: %branch%
|
|
|
|
echo Revision: %revision%
|
|
|
|
echo Package version: %package_version%
|
|
|
|
echo Clang format plugin version: %clang_format_vs_version%
|
|
|
|
echo Build dir: %build_dir%
|
|
|
|
echo.
|
|
|
|
pause
|
|
|
|
|
|
|
|
mkdir %build_dir%
|
|
|
|
cd %build_dir%
|
|
|
|
|
|
|
|
echo Checking out %branch% at r%revision%...
|
|
|
|
svn.exe export -r %revision% http://llvm.org/svn/llvm-project/llvm/%branch% llvm || exit /b
|
|
|
|
svn.exe export -r %revision% http://llvm.org/svn/llvm-project/cfe/%branch% llvm/tools/clang || exit /b
|
|
|
|
svn.exe export -r %revision% http://llvm.org/svn/llvm-project/clang-tools-extra/%branch% llvm/tools/clang/tools/extra || exit /b
|
|
|
|
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
|
2016-05-04 00:43:40 +08:00
|
|
|
svn.exe export -r %revision% http://llvm.org/svn/llvm-project/openmp/%branch% llvm/projects/openmp || exit /b
|
2016-09-16 07:01:03 +08:00
|
|
|
svn.exe export -r %revision% http://llvm.org/svn/llvm-project/lldb/%branch% llvm/tools/lldb || exit /b
|
2015-12-11 08:43:42 +08:00
|
|
|
|
|
|
|
|
2016-05-04 00:43:40 +08:00
|
|
|
REM Setting CMAKE_CL_SHOWINCLUDES_PREFIX to work around PR27226.
|
2016-09-16 07:01:03 +08:00
|
|
|
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: "
|
2015-12-11 08:43:42 +08:00
|
|
|
|
|
|
|
REM TODO: Run all tests, including lld and compiler-rt.
|
|
|
|
|
|
|
|
call "%vcdir%/vcvarsall.bat" x86
|
|
|
|
set CC=
|
|
|
|
set CXX=
|
|
|
|
mkdir build32_stage0
|
|
|
|
cd build32_stage0
|
2016-09-16 07:01:03 +08:00
|
|
|
cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python32_dir% ..\llvm || exit /b
|
2015-12-11 08:43:42 +08:00
|
|
|
ninja all || exit /b
|
2016-07-28 04:38:01 +08:00
|
|
|
ninja check || ninja check || ninja check || exit /b
|
|
|
|
ninja check-clang || ninja check-clang || ninja check-clang || exit /b
|
2015-12-11 08:43:42 +08:00
|
|
|
cd..
|
|
|
|
|
|
|
|
mkdir build32
|
|
|
|
cd build32
|
|
|
|
set CC=..\build32_stage0\bin\clang-cl
|
|
|
|
set CXX=..\build32_stage0\bin\clang-cl
|
2016-09-16 07:01:03 +08:00
|
|
|
cmake -GNinja %cmake_flags% -DBUILD_CLANG_FORMAT_VS_PLUGIN=ON -DPYTHON_HOME=%python32_dir% ..\llvm || exit /b
|
2015-12-11 08:43:42 +08:00
|
|
|
ninja all || exit /b
|
2016-07-28 04:38:01 +08:00
|
|
|
ninja check || ninja check || ninja check || exit /b
|
|
|
|
ninja check-clang || ninja check-clang || ninja check-clang || exit /b
|
2015-12-11 08:43:42 +08:00
|
|
|
copy ..\llvm\tools\clang\tools\clang-format-vs\ClangFormat\bin\Release\ClangFormat.vsix ClangFormat-r%revision%.vsix
|
|
|
|
ninja package || exit /b
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
|
|
|
|
call "%vcdir%/vcvarsall.bat" amd64
|
|
|
|
set CC=
|
|
|
|
set CXX=
|
|
|
|
mkdir build64_stage0
|
|
|
|
cd build64_stage0
|
2016-09-16 07:01:03 +08:00
|
|
|
cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python64_dir% ..\llvm || exit /b
|
2015-12-11 08:43:42 +08:00
|
|
|
ninja all || exit /b
|
2016-07-28 04:38:01 +08:00
|
|
|
ninja check || ninja check || ninja check || exit /b
|
|
|
|
ninja check-clang || ninja check-clang || ninja check-clang || exit /b
|
2015-12-11 08:43:42 +08:00
|
|
|
cd..
|
|
|
|
|
|
|
|
mkdir build64
|
|
|
|
cd build64
|
|
|
|
set CC=..\build64_stage0\bin\clang-cl
|
|
|
|
set CXX=..\build64_stage0\bin\clang-cl
|
2016-09-16 07:01:03 +08:00
|
|
|
cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python64_dir% ..\llvm || exit /b
|
2015-12-11 08:43:42 +08:00
|
|
|
ninja all || exit /b
|
2016-07-28 04:38:01 +08:00
|
|
|
ninja check || ninja check || ninja check || exit /b
|
|
|
|
ninja check-clang || ninja check-clang || ninja check-clang || exit /b
|
2015-12-11 08:43:42 +08:00
|
|
|
ninja package || exit /b
|
|
|
|
cd ..
|