@@ -21,8 +21,8 @@ REM https://github.com/swig/swig/issues/769
21
21
REM You need to modify the paths below:
22
22
set vsdevcmd = C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\Tools\VsDevCmd.bat
23
23
24
- set python32_dir = C:\Users\%USERNAME% \AppData\Local\Programs\Python\Python36 -32
25
- set python64_dir = C:\Users\%USERNAME% \AppData\Local\Programs\Python\Python36
24
+ set python32_dir = C:\Users\%USERNAME% \AppData\Local\Programs\Python\Python310 -32
25
+ set python64_dir = C:\Users\%USERNAME% \AppData\Local\Programs\Python\Python310
26
26
27
27
for /f " usebackq" %%i in (`PowerShell ^ (Get-Date^ ).ToString^ ('yyyyMMdd'^ )`) do set datestamp = %%i
28
28
@@ -33,7 +33,6 @@ set build_dir=llvm_package_%revision:~0,8%
33
33
34
34
echo Revision: %revision%
35
35
echo Package version: %package_version%
36
- echo Clang format plugin version: %clang_format_vs_version%
37
36
echo Build dir: %build_dir%
38
37
echo .
39
38
pause
@@ -49,47 +48,49 @@ mv llvm-project-* llvm-project || exit /b
49
48
REM Setting CMAKE_CL_SHOWINCLUDES_PREFIX to work around PR27226.
50
49
set cmake_flags = ^
51
50
-DCMAKE_BUILD_TYPE=Release ^
52
- -DLLVM_ENABLE_ASSERTIONS=ON ^
51
+ -DLLVM_ENABLE_ASSERTIONS=OFF ^
53
52
-DLLVM_INSTALL_TOOLCHAIN_ONLY=ON ^
54
53
-DLLVM_BUILD_LLVM_C_DYLIB=ON ^
55
54
-DCMAKE_INSTALL_UCRT_LIBRARIES=ON ^
56
- -DCLANG_FORMAT_VS_VERSION= %clang_format_vs_version% ^
55
+ -DPython3_FIND_REGISTRY=NEVER ^
57
56
-DPACKAGE_VERSION=%package_version% ^
58
57
-DLLDB_RELOCATABLE_PYTHON=1 ^
58
+ -DLLDB_EMBED_PYTHON_HOME=OFF ^
59
59
-DLLDB_TEST_COMPILER=%cd% \build32_stage0\bin\clang.exe ^
60
60
-DCMAKE_CL_SHOWINCLUDES_PREFIX=" Note: including file: " ^
61
- -DLLVM_ENABLE_PROJECTS=" clang;clang-tools-extra;lld;compiler-rt;openmp; lldb"
61
+ -DLLVM_ENABLE_PROJECTS=" clang;clang-tools-extra;lld;compiler-rt;lldb;openmp "
62
62
63
63
REM TODO: Run the "check-all" tests.
64
64
65
+ set OLDPATH = %PATH%
66
+
65
67
set " VSCMD_START_DIR = %CD% "
66
68
call " %vsdevcmd% " -arch=x86
69
+ set PATH = %python32_dir% ;%PATH%
67
70
set CC =
68
71
set CXX =
69
72
mkdir build32_stage0
70
73
cd build32_stage0
71
- cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python32_dir% -DPYTHON_EXECUTABLE =%python32_dir% \python.exe ..\llvm-project\llvm || exit /b
72
- ninja all || ninja all || ninja all || exit /b
73
- ninja check || ninja check || ninja check || exit /b
74
- ninja check-clang || ninja check-clang || ninja check-clang || exit /b
74
+ cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python32_dir% -DPython3_ROOT_DIR =%python32_dir% ..\llvm-project\llvm || exit /b
75
+ ninja || ninja || ninja || exit /b
76
+ REM ninja check-llvm || ninja check-llvm || ninja check-llvm || exit /b
77
+ REM ninja check-clang || ninja check-clang || ninja check-clang || exit /b
75
78
ninja check-lld || ninja check-lld || ninja check-lld || exit /b
76
79
ninja check-sanitizer || ninja check-sanitizer || ninja check-sanitizer || exit /b
77
- ninja check-clang-tools || ninja check-clang-tools || ninja check-clang-tools || exit /b
78
- ninja check-clangd || ninja check-clangd || ninja check-clangd || exit /b
80
+ REM ninja check-clang-tools || ninja check-clang-tools || ninja check-clang-tools || exit /b
79
81
cd..
80
82
81
83
mkdir build32
82
84
cd build32
83
85
set CC = ..\build32_stage0\bin\clang-cl
84
86
set CXX = ..\build32_stage0\bin\clang-cl
85
- cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python32_dir% -DPYTHON_EXECUTABLE =%python32_dir% \python.exe ..\llvm-project\llvm || exit /b
86
- ninja all || ninja all || ninja all || exit /b
87
- ninja check || ninja check || ninja check || exit /b
88
- ninja check-clang || ninja check-clang || ninja check-clang || exit /b
87
+ cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python32_dir% -DPython3_ROOT_DIR =%python32_dir% ..\llvm-project\llvm || exit /b
88
+ ninja || ninja || ninja || exit /b
89
+ REM ninja check-llvm || ninja check-llvm || ninja check-llvm || exit /b
90
+ REM ninja check-clang || ninja check-clang || ninja check-clang || exit /b
89
91
ninja check-lld || ninja check-lld || ninja check-lld || exit /b
90
92
ninja check-sanitizer || ninja check-sanitizer || ninja check-sanitizer || exit /b
91
- ninja check-clang-tools || ninja check-clang-tools || ninja check-clang-tools || exit /b
92
- ninja check-clangd || ninja check-clangd || ninja check-clangd || exit /b
93
+ REM ninja check-clang-tools || ninja check-clang-tools || ninja check-clang-tools || exit /b
93
94
ninja package || exit /b
94
95
95
96
7z x LLVM-%package_version% -win32.exe -orepack
@@ -99,28 +100,17 @@ del repack\Uninstall.exe
99
100
cd ..
100
101
101
102
102
- REM The plug-in is built separately as it uses a statically linked clang-format.exe.
103
- mkdir build_vsix
104
- cd build_vsix
105
- REM Having VSSDKINSTALL set makes devenv *not* find the SDK for some reason.
106
- set VSSDKINSTALL =
107
- set CC = ..\build32_stage0\bin\clang-cl
108
- set CXX = ..\build32_stage0\bin\clang-cl
109
- cmake -GNinja %cmake_flags% -DLLVM_USE_CRT_RELEASE=MT -DBUILD_CLANG_FORMAT_VS_PLUGIN=ON -DPYTHON_HOME=%python32_dir% -DPYTHON_EXECUTABLE=%python32_dir% \python.exe ..\llvm-project\llvm || exit /b
110
- ninja clang_format_vsix || exit /b
111
- copy ..\llvm-project\llvm\tools\clang\tools\clang-format-vs\ClangFormat\bin\Release\ClangFormat.vsix ClangFormat-r%revision% .vsix
112
- cd ..
113
-
114
-
115
103
set " VSCMD_START_DIR = %CD% "
104
+ set PATH = %OLDPATH%
116
105
call " %vsdevcmd% " -arch=amd64
106
+ set PATH = %python64_dir% ;%PATH%
117
107
set CC =
118
108
set CXX =
119
109
mkdir build64_stage0
120
110
cd build64_stage0
121
- cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python64_dir% -DPYTHON_EXECUTABLE =%python64_dir% \python.exe ..\llvm-project\llvm || exit /b
122
- ninja all || ninja all || ninja all || exit /b
123
- ninja check || ninja check || ninja check || exit /b
111
+ cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python64_dir% -DPython3_ROOT_DIR =%python64_dir% ..\llvm-project\llvm || exit /b
112
+ ninja || ninja || ninja || exit /b
113
+ ninja check-llvm || ninja check-llvm || ninja check-llvm || exit /b
124
114
ninja check-clang || ninja check-clang || ninja check-clang || exit /b
125
115
ninja check-lld || ninja check-lld || ninja check-lld || exit /b
126
116
ninja check-sanitizer || ninja check-sanitizer || ninja check-sanitizer || exit /b
@@ -132,9 +122,9 @@ mkdir build64
132
122
cd build64
133
123
set CC = ..\build64_stage0\bin\clang-cl
134
124
set CXX = ..\build64_stage0\bin\clang-cl
135
- cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python64_dir% -DPYTHON_EXECUTABLE =%python64_dir% \python.exe ..\llvm-project\llvm || exit /b
136
- ninja all || ninja all || ninja all || exit /b
137
- ninja check || ninja check || ninja check || exit /b
125
+ cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python64_dir% -DPython3_ROOT_DIR =%python64_dir% ..\llvm-project\llvm || exit /b
126
+ ninja || ninja || ninja || exit /b
127
+ ninja check-llvm || ninja check-llvm || ninja check-llvm || exit /b
138
128
ninja check-clang || ninja check-clang || ninja check-clang || exit /b
139
129
ninja check-lld || ninja check-lld || ninja check-lld || exit /b
140
130
ninja check-sanitizer || ninja check-sanitizer || ninja check-sanitizer || exit /b
0 commit comments