summaryrefslogtreecommitdiffstats
path: root/.gitlab/ci/clang-env.ps1
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-11-10 14:29:29 (GMT)
committerBrad King <brad.king@kitware.com>2022-11-10 18:24:31 (GMT)
commit8ba5835c8d77b5d61847eba06feac8cfd6682b45 (patch)
tree0db76a0b7215f3e160c600b32a145f30aac70e41 /.gitlab/ci/clang-env.ps1
parentbf2e4a2e857c1e9c9caf73bdf05cc1efc111c196 (diff)
downloadCMake-8ba5835c8d77b5d61847eba06feac8cfd6682b45.zip
CMake-8ba5835c8d77b5d61847eba06feac8cfd6682b45.tar.gz
CMake-8ba5835c8d77b5d61847eba06feac8cfd6682b45.tar.bz2
ci: Factor out helper to load clang into environment on Windows
Diffstat (limited to '.gitlab/ci/clang-env.ps1')
-rwxr-xr-x.gitlab/ci/clang-env.ps115
1 files changed, 15 insertions, 0 deletions
diff --git a/.gitlab/ci/clang-env.ps1 b/.gitlab/ci/clang-env.ps1
new file mode 100755
index 0000000..451fca3
--- /dev/null
+++ b/.gitlab/ci/clang-env.ps1
@@ -0,0 +1,15 @@
+Invoke-Expression -Command .gitlab/ci/clang.ps1
+Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1
+
+$pwdpath = $pwd.Path
+Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\llvm\bin;$env:PATH"
+
+if ("$env:CMAKE_CI_BUILD_NAME" -match "(^|_)gnu(_|$)") {
+ $env:CC = "clang"
+ $env:CXX = "clang++"
+ clang --version
+} else {
+ $env:CC = "clang-cl"
+ $env:CXX = "clang-cl"
+ clang-cl --version
+}