Skip to content

Commit e7f5873

Browse files
committed
utils: update the build-windows-toolchain.bat to extract the toolchain
Fetch a prebuilt toolchain to build the toolchain. This is required to enable the macro support on Windows.
1 parent 8a2aeb9 commit e7f5873

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

utils/build-windows-toolchain.bat

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ del /f /q "%UniversalCRTSdkDir%\Include\%UCRTVersion%\um\module.modulemap"
5050
del /f /q "%VCToolsInstallDir%\include\module.modulemap"
5151
del /f /q "%VCToolsInstallDir%\include\vcruntime.apinotes"
5252

53+
call :FetchWiX || (exit /b)
54+
call :FetchX64Toolchain || (exit /b)
5355
call :CloneDependencies || (exit /b)
5456
call :CloneRepositories || (exit /b)
5557

@@ -815,6 +817,30 @@ git clone --quiet --no-tags --depth 1 --branch curl-7_77_0 https://github.com/cu
815817
goto :eof
816818
endlocal
817819

820+
:FetchWiX
821+
setlocal enableextensions enabledelayedexpansion
822+
823+
curl.exe -sL https://www.nuget.org/api/v2/package/wix/4.0.1 -o wix-4.0.1.zip
824+
md WiX-4.0.1 || exit (/b)
825+
cd WiX-4.0.1 || exit (/b)
826+
tar -xf ../wix-4.0.1.zip || exit (/b)
827+
828+
goto :eof
829+
endlocal
830+
831+
:FetchX64Toolchain
832+
setlocal enableextensions enabledelayedexpansion
833+
834+
curl.exe -OL --ssl "download.swift.org/development/windows10/swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a/swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a-windows10.exe" || (exit /b)
835+
"WiX-4.0.1\tools\net6.0\any\wix.exe" burn extract swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a-windows10.exe -o %BuildRoot%\toolchains || (exit /b)
836+
msiexec.exe /qn /a "%BuildRoot%\toolchains\a0" TARGETDIR="%BuildRoot%\toolchains\swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a\PFiles64\Swift\Runtimes\0.0.0\usr\bin\ || (exit /b)
837+
msiexec.exe /qn /a "%BuildRoot%\toolchains\a1" TARGETDIR="%BuildRoot%\toolchains\swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a\ || (exit /b)
838+
msiexec.exe /qn /a "%BuildRoot%\toolchains\a2" TARGETDIR="%BuildRoot%\toolchains\swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a\ || (exit /b)
839+
msiexec.exe /qn /a "%BuildRoot%\toolchains\a5" TARGETDIR="%BuildRoot%\toolchains\swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a\ || (exit /b)
840+
841+
goto :eof
842+
endlocal
843+
818844
:TestSwift
819845
setlocal enableextensions enabledelayedexpansion
820846

0 commit comments

Comments
 (0)