diff options
author | Brad King <brad.king@kitware.com> | 2022-02-02 20:53:23 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-02-04 13:24:53 (GMT) |
commit | c1f4bd792b28af10ded274e569b4b75cc722f0b7 (patch) | |
tree | 31eeee3197f8afe90e32708aa61b981662a06430 /.gitlab/ci/clang.ps1 | |
parent | f84dcbd496ad6abb1491b621142e2c222f23c11c (diff) | |
download | CMake-c1f4bd792b28af10ded274e569b4b75cc722f0b7.zip CMake-c1f4bd792b28af10ded274e569b4b75cc722f0b7.tar.gz CMake-c1f4bd792b28af10ded274e569b4b75cc722f0b7.tar.bz2 |
ci: Add LLVM/Clang 13.0 nightly CI jobs on Windows
Add jobs covering the `clang-cl` front-end with Ninja and NMake.
Add a job covering the `clang++` front-end with Ninja.
Diffstat (limited to '.gitlab/ci/clang.ps1')
-rwxr-xr-x | .gitlab/ci/clang.ps1 | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/.gitlab/ci/clang.ps1 b/.gitlab/ci/clang.ps1 new file mode 100755 index 0000000..25d64ba --- /dev/null +++ b/.gitlab/ci/clang.ps1 @@ -0,0 +1,37 @@ +$erroractionpreference = "stop" + +if ("$env:CMAKE_CI_BUILD_NAME".Contains("clang13.0")) { + # LLVM/Clang 13.0 + # https://github.com/llvm/llvm-project/releases/tag/llvmorg-13.0.0 + $filename = "llvm-13.0.0-win-x86_64-1" + $sha256sum = "F1B7CE360DACBC9776D7F84BE714766D60CF3D47492AFE34C45D574D1C597264" +} else { + throw ('unknown CMAKE_CI_BUILD_NAME: ' + "$env:CMAKE_CI_BUILD_NAME") +} +$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\llvm" + +$bin = "$outdir\llvm\bin" +$null = New-Item -ItemType HardLink -Path "$bin\clang++.exe" -Target "$bin\clang.exe" +$null = New-Item -ItemType HardLink -Path "$bin\clang-cl.exe" -Target "$bin\clang.exe" +$null = New-Item -ItemType HardLink -Path "$bin\clang-cpp.exe" -Target "$bin\clang.exe" +$null = New-Item -ItemType HardLink -Path "$bin\ld.lld.exe" -Target "$bin\lld.exe" +$null = New-Item -ItemType HardLink -Path "$bin\ld64.lld.exe" -Target "$bin\lld.exe" +$null = New-Item -ItemType HardLink -Path "$bin\lld-link.exe" -Target "$bin\lld.exe" +$null = New-Item -ItemType HardLink -Path "$bin\llvm-lib.exe" -Target "$bin\llvm-ar.exe" +$null = New-Item -ItemType HardLink -Path "$bin\llvm-ranlib.exe" -Target "$bin\llvm-ar.exe" +$null = New-Item -ItemType HardLink -Path "$bin\llvm-objcopy.exe" -Target "$bin\llvm-strip.exe" +Clear-Variable -Name bin |