llvm.org GIT mirror llvm / 0dbeff1
Check in the script for building Win snapshots git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255318 91177308-0d34-0410-b5e6-96231b3b80d8 Hans Wennborg 4 years ago
1 changed file(s) with 93 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 @echo off
1 setlocal
2
3 REM Script for building the LLVM installer on Windows,
4 REM used for the the weekly snapshots at http://www.llvm.org/builds.
5 REM
6 REM Usage: build_llvm_package.bat
7
8 REM Prerequisites:
9 REM
10 REM Visual Studio 2013, CMake, Ninja, SVN, GNUWin32,
11 REM NSIS with the strlen_8192 patch,
12 REM Visual Studio 2013 SDK (for the clang-format plugin).
13
14
15 REM You may need to modify the paths below:
16 set vcdir=c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC
17 set PATH=%PATH%;c:\gnuwin32\bin
18
19 set revision=%1
20 set branch=trunk
21 set package_version=3.8.0-r%revision%
22 set clang_format_vs_version=3.8.0.%revision%
23 set build_dir=llvm_package_%revision%
24
25 echo Branch: %branch%
26 echo Revision: %revision%
27 echo Package version: %package_version%
28 echo Clang format plugin version: %clang_format_vs_version%
29 echo Build dir: %build_dir%
30 echo.
31 pause
32
33 mkdir %build_dir%
34 cd %build_dir%
35
36 echo Checking out %branch% at r%revision%...
37 svn.exe export -r %revision% http://llvm.org/svn/llvm-project/llvm/%branch% llvm || exit /b
38 svn.exe export -r %revision% http://llvm.org/svn/llvm-project/cfe/%branch% llvm/tools/clang || exit /b
39 svn.exe export -r %revision% http://llvm.org/svn/llvm-project/clang-tools-extra/%branch% llvm/tools/clang/tools/extra || exit /b
40 svn.exe export -r %revision% http://llvm.org/svn/llvm-project/lld/%branch% llvm/tools/lld || exit /b
41 svn.exe export -r %revision% http://llvm.org/svn/llvm-project/compiler-rt/%branch% llvm/projects/compiler-rt || exit /b
42
43
44 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%
45
46 REM TODO: Run all tests, including lld and compiler-rt.
47
48 call "%vcdir%/vcvarsall.bat" x86
49 set CC=
50 set CXX=
51 mkdir build32_stage0
52 cd build32_stage0
53 cmake -GNinja %cmake_flags% ..\llvm || exit /b
54 ninja all || exit /b
55 ninja check || exit /b
56 ninja check-clang || exit /b
57 cd..
58
59 mkdir build32
60 cd build32
61 set CC=..\build32_stage0\bin\clang-cl
62 set CXX=..\build32_stage0\bin\clang-cl
63 cmake -GNinja %cmake_flags% -DBUILD_CLANG_FORMAT_VS_PLUGIN=ON ..\llvm || exit /b
64 ninja all || exit /b
65 ninja check || exit /b
66 ninja check-clang || exit /b
67 copy ..\llvm\tools\clang\tools\clang-format-vs\ClangFormat\bin\Release\ClangFormat.vsix ClangFormat-r%revision%.vsix
68 ninja package || exit /b
69 cd ..
70
71
72 call "%vcdir%/vcvarsall.bat" amd64
73 set CC=
74 set CXX=
75 mkdir build64_stage0
76 cd build64_stage0
77 cmake -GNinja %cmake_flags% ..\llvm || exit /b
78 ninja all || exit /b
79 ninja check || exit /b
80 ninja check-clang || exit /b
81 cd..
82
83 mkdir build64
84 cd build64
85 set CC=..\build64_stage0\bin\clang-cl
86 set CXX=..\build64_stage0\bin\clang-cl
87 cmake -GNinja %cmake_flags% ..\llvm || exit /b
88 ninja all || exit /b
89 ninja check || exit /b
90 ninja check-clang || exit /b
91 ninja package || exit /b
92 cd ..