summaryrefslogtreecommitdiffstats
path: root/.gitlab/ci/msvc.ps1
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-11-01 21:30:59 (GMT)
committerBrad King <brad.king@kitware.com>2021-11-01 21:35:00 (GMT)
commit11903f1b5f74033d4a9a301a65dc6d7524ee4440 (patch)
treea72e5f951e15f03415a3c15dbd88291163c117cd /.gitlab/ci/msvc.ps1
parentdac334e35c0a47f9de5958554631954257bdb9fb (diff)
downloadCMake-11903f1b5f74033d4a9a301a65dc6d7524ee4440.zip
CMake-11903f1b5f74033d4a9a301a65dc6d7524ee4440.tar.gz
CMake-11903f1b5f74033d4a9a301a65dc6d7524ee4440.tar.bz2
ci: Add MSVC v71 NMake nightly CI job
Diffstat (limited to '.gitlab/ci/msvc.ps1')
-rwxr-xr-x.gitlab/ci/msvc.ps131
1 files changed, 31 insertions, 0 deletions
diff --git a/.gitlab/ci/msvc.ps1 b/.gitlab/ci/msvc.ps1
new file mode 100755
index 0000000..e8388a4
--- /dev/null
+++ b/.gitlab/ci/msvc.ps1
@@ -0,0 +1,31 @@
+$erroractionpreference = "stop"
+
+if ("$env:CMAKE_CONFIGURATION".Contains("msvc_v71")) {
+ # MSVC v71 Toolset from Visual Studio 7 .NET 2003
+ $filename = "msvc-v71-1"
+ $sha256sum = "01637CDC670EA5D631E169E286ACDD1913A124E3C5AF4C3DFB37657ADE8BBA9F"
+ $vcvars = "Vc7\bin\vcvars32.bat"
+} else {
+ throw ('unknown CMAKE_CONFIGURATION: ' + "$env:CMAKE_CONFIGURATION")
+}
+$tarball = "$filename.zip"
+
+$outdir = $pwd.Path
+$outdir = "$outdir\.gitlab"
+$ProgressPreference = 'SilentlyContinue'
+# This URL is only visible inside of Kitware's network. See above filename table.
+Invoke-WebRequest -Uri "https://cmake.org/files/dependencies/internal/$tarball" -OutFile "$outdir\$tarball"
+$hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256
+if ($hash.Hash -ne $sha256sum) {
+ exit 1
+}
+
+Add-Type -AssemblyName System.IO.Compression.FileSystem
+[System.IO.Compression.ZipFile]::ExtractToDirectory("$outdir\$tarball", "$outdir")
+Move-Item -Path "$outdir\$filename" -Destination "$outdir\msvc"
+
+$bat = Get-Content -path "$outdir\msvc\$vcvars.in" -Raw
+$bat = $bat -replace "@VS_ROOT@","$outdir\msvc"
+$bat | Set-Content -path "$outdir\msvc\$vcvars"
+
+Set-Item -Force -Path "env:VCVARSALL" -Value "$outdir\msvc\$vcvars"