@@ -50,6 +50,8 @@ del /f /q "%UniversalCRTSdkDir%\Include\%UCRTVersion%\um\module.modulemap"
50
50
del /f /q " %VCToolsInstallDir% \include\module.modulemap"
51
51
del /f /q " %VCToolsInstallDir% \include\vcruntime.apinotes"
52
52
53
+ call :FetchWiX || (exit /b)
54
+ call :FetchX64Toolchain || (exit /b)
53
55
call :CloneDependencies || (exit /b)
54
56
call :CloneRepositories || (exit /b)
55
57
@@ -186,6 +188,33 @@ cmake ^
186
188
cmake --build " %BuildRoot% \curl" || (exit /b)
187
189
cmake --build " %BuildRoot% \curl" --target install || (exit /b)
188
190
191
+ path %BuildRoot% \toolchains\5.9.0\PFiles64\Swift\runtime-development\usr\bin;%BuildRoot% \toolchains\5.9.0\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin;%Path%
192
+
193
+ :: Build Swift Syntax
194
+ cmake ^
195
+ -B " %BuildRoot% \99" ^
196
+
197
+ -D BUILD_SHARED_LIBS=YES ^
198
+ -D CMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE% ^
199
+ -D CMAKE_C_COMPILER=cl.exe ^
200
+ -D CMAKE_C_FLAGS=" /GS- /Oy /Gw /Gy" ^
201
+ -D CMAKE_CXX_COMPILER=cl ^
202
+ -D CMAKE_CXX_FLAGS=" /GS- /Oy /Gw /Gy" ^
203
+ -D CMAKE_MT=mt ^
204
+ -D CMAKE_Swift_COMPILER=%BuildRoot% /toolchains/5.9.0/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe ^
205
+ -D CMAKE_Swift_FLAGS=" -sdk %BuildRoot% /toolchains/5.9.0/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" ^
206
+ -D CMAKE_EXE_LINKER_FLAGS=" /INCREMENTAL:NO" ^
207
+ -D CMAKE_SHARED_LINKER_FLAGS=" /INCREMENTAL:NO" ^
208
+
209
+ -D CMAKE_INSTALL_PREFIX=" %InstallRoot% " ^
210
+
211
+ -D SWIFT_SYNTAX_ENABLE_WMO_PRE_3_26=YES ^
212
+
213
+ -G Ninja ^
214
+ -S %SourceRoot% \swift-syntax || (exit /b)
215
+ cmake --build %BuildRoot% \99 || (exit /b)
216
+ cmake --build %BuildRoot% \99 --target install || (exit /b)
217
+
189
218
:: Build Toolchain
190
219
cmake ^
191
220
-B " %BuildRoot% \1" ^
@@ -203,6 +232,9 @@ cmake ^
203
232
204
233
-D CMAKE_INSTALL_PREFIX=" %InstallRoot% " ^
205
234
235
+ -D CMAKE_Swift_COMPILER=" %BuildRoot% /toolchains/5.9.0/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe" ^
236
+ -D CMAKE_Swift_FLAGS=" -sdk %BuildRoot% /toolchains/5.9.0/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" ^
237
+
206
238
-D LLVM_DEFAULT_TARGET_TRIPLE=x86_64-unknown-windows-msvc ^
207
239
208
240
-D PACKAGE_VENDOR=" swift.org" ^
@@ -225,9 +257,11 @@ cmake ^
225
257
-D LLVM_EXTERNAL_CMARK_SOURCE_DIR=" %SourceRoot% \cmark" ^
226
258
-D PYTHON_HOME=%PYTHON_HOME% ^
227
259
-D PYTHON_EXECUTABLE=%PYTHON_HOME% \python.exe ^
260
+ -D SWIFT_PATH_TO_EARLYSWIFTSYNTAX_BUILD_DIR=" %BuildRoot% \99" ^
228
261
-D SWIFT_PATH_TO_LIBDISPATCH_SOURCE=" %SourceRoot% \swift-corelibs-libdispatch" ^
229
262
-D SWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE=" %SourceRoot% \swift-syntax" ^
230
263
-D SWIFT_PATH_TO_STRING_PROCESSING_SOURCE=%SourceRoot% \swift-experimental-string-processing ^
264
+ -D SWIFT_PATH_TO_SWIFT_SDK=" %BuildRoot% /toolchains/5.9.0/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" ^
231
265
232
266
-G Ninja ^
233
267
-S llvm-project\llvm || (exit /b)
@@ -818,6 +852,31 @@ git clone --quiet --no-tags --depth 1 --branch curl-7_77_0 https://github.com/cu
818
852
goto :eof
819
853
endlocal
820
854
855
+ :FetchWiX
856
+ setlocal enableextensions enabledelayedexpansion
857
+
858
+ if exist wix-4.0.1 goto :eof
859
+ curl.exe -sL https://www.nuget.org/api/v2/package/wix/4.0.1 -o wix-4.0.1.zip
860
+ md WiX-4.0.1
861
+ cd WiX-4.0.1 || exit (/b)
862
+ tar -xf ../wix-4.0.1.zip || exit (/b)
863
+
864
+ goto :eof
865
+ endlocal
866
+
867
+ :FetchX64Toolchain
868
+ setlocal enableextensions enabledelayedexpansion
869
+
870
+ curl.exe -k -sOL " https://download.swift.org/swift-5.9-release/windows10/swift-5.9-RELEASE/swift-5.9-RELEASE-windows10.exe" || (exit /b)
871
+ " WiX-4.0.1\tools\net6.0\any\wix.exe" burn extract swift-5.9-RELEASE-windows10.exe -o %BuildRoot% \toolchains || (exit /b)
872
+ msiexec.exe /qn /a " %BuildRoot% \toolchains\a0" TARGETDIR=" %BuildRoot% \toolchains\5.9.0\" || (exit /b)
873
+ msiexec.exe /qn /a " %BuildRoot% \toolchains\a1" TARGETDIR=" %BuildRoot% \toolchains\5.9.0\" || (exit /b)
874
+ msiexec.exe /qn /a " %BuildRoot% \toolchains\a2" TARGETDIR=" %BuildRoot% \toolchains\5.9.0\" || (exit /b)
875
+ msiexec.exe /qn /a " %BuildRoot% \toolchains\a3" TARGETDIR=" %BuildRoot% \toolchains\5.9.0\" || (exit /b)
876
+
877
+ goto :eof
878
+ endlocal
879
+
821
880
:TestSwift
822
881
setlocal enableextensions enabledelayedexpansion
823
882
0 commit comments