diff options
author | Brad King <brad.king@kitware.com> | 2022-11-10 14:29:29 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-11-10 18:24:31 (GMT) |
commit | 8ba5835c8d77b5d61847eba06feac8cfd6682b45 (patch) | |
tree | 0db76a0b7215f3e160c600b32a145f30aac70e41 /.gitlab | |
parent | bf2e4a2e857c1e9c9caf73bdf05cc1efc111c196 (diff) | |
download | CMake-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')
-rwxr-xr-x | .gitlab/ci/clang-env.ps1 | 15 | ||||
-rw-r--r-- | .gitlab/ci/env_windows_clang_common.cmake | 7 | ||||
-rw-r--r-- | .gitlab/ci/env_windows_clang_ninja.cmake | 1 | ||||
-rw-r--r-- | .gitlab/ci/env_windows_clang_nmake.cmake | 1 | ||||
-rw-r--r-- | .gitlab/os-windows.yml | 5 |
5 files changed, 16 insertions, 13 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 +} diff --git a/.gitlab/ci/env_windows_clang_common.cmake b/.gitlab/ci/env_windows_clang_common.cmake deleted file mode 100644 index fdd668f..0000000 --- a/.gitlab/ci/env_windows_clang_common.cmake +++ /dev/null @@ -1,7 +0,0 @@ -if("$ENV{CMAKE_CI_BUILD_NAME}" MATCHES "(^|_)gnu(_|$)") - set(ENV{CC} clang) - set(ENV{CXX} clang++) -else() - set(ENV{CC} clang-cl) - set(ENV{CXX} clang-cl) -endif() diff --git a/.gitlab/ci/env_windows_clang_ninja.cmake b/.gitlab/ci/env_windows_clang_ninja.cmake deleted file mode 100644 index f3834a2..0000000 --- a/.gitlab/ci/env_windows_clang_ninja.cmake +++ /dev/null @@ -1 +0,0 @@ -include("${CMAKE_CURRENT_LIST_DIR}/env_windows_clang_common.cmake") diff --git a/.gitlab/ci/env_windows_clang_nmake.cmake b/.gitlab/ci/env_windows_clang_nmake.cmake deleted file mode 100644 index f3834a2..0000000 --- a/.gitlab/ci/env_windows_clang_nmake.cmake +++ /dev/null @@ -1 +0,0 @@ -include("${CMAKE_CURRENT_LIST_DIR}/env_windows_clang_common.cmake") diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml index 78ebb2e..6f9c292 100644 --- a/.gitlab/os-windows.yml +++ b/.gitlab/os-windows.yml @@ -396,10 +396,7 @@ script: - . .gitlab/ci/env.ps1 - . .gitlab/ci/ninja-env.ps1 - - 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" + - . .gitlab/ci/clang-env.ps1 - build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_standalone.cmake interruptible: true |