summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-11-10 14:22:11 (GMT)
committerBrad King <brad.king@kitware.com>2022-11-10 17:57:55 (GMT)
commitbf2e4a2e857c1e9c9caf73bdf05cc1efc111c196 (patch)
tree76a4805fafe0d09e81e2fe104d5ba0eb08fbc1ad
parent93ff726114cce9390728d6ff701526f491a14709 (diff)
downloadCMake-bf2e4a2e857c1e9c9caf73bdf05cc1efc111c196.zip
CMake-bf2e4a2e857c1e9c9caf73bdf05cc1efc111c196.tar.gz
CMake-bf2e4a2e857c1e9c9caf73bdf05cc1efc111c196.tar.bz2
ci: Factor out helper to load ninja into environment on Windows
-rwxr-xr-x.gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps15
-rwxr-xr-x.gitlab/ci/ninja-env.ps14
-rw-r--r--.gitlab/os-windows.yml9
3 files changed, 8 insertions, 10 deletions
diff --git a/.gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps1 b/.gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps1
index e5f538a..44bb090 100755
--- a/.gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps1
+++ b/.gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps1
@@ -2,9 +2,6 @@ if ("$env:CMAKE_CI_NIGHTLY" -eq "true") {
. ".gitlab/ci/ispc-env.ps1"
}
-$pwdpath = $pwd.Path
-& "$pwsh" -File ".gitlab/ci/ninja.ps1"
-Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab;$env:PATH"
-ninja --version
+. .gitlab/ci/ninja-env.ps1
Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1
diff --git a/.gitlab/ci/ninja-env.ps1 b/.gitlab/ci/ninja-env.ps1
new file mode 100755
index 0000000..67c7036
--- /dev/null
+++ b/.gitlab/ci/ninja-env.ps1
@@ -0,0 +1,4 @@
+$pwdpath = $pwd.Path
+& "$pwsh" -File ".gitlab/ci/ninja.ps1"
+Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab;$env:PATH"
+Write-Host "ninja version: $(ninja --version)"
diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml
index 5c6be11..78ebb2e 100644
--- a/.gitlab/os-windows.yml
+++ b/.gitlab/os-windows.yml
@@ -299,11 +299,9 @@
- Set-Item -Force -Path "env:WIX" -Value "$pwdpath\.gitlab\wix"
- (& "$pwsh" -File ".gitlab/ci/cmake.ps1")
- Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\cmake\bin;$env:PATH"
- - (& "$pwsh" -File ".gitlab/ci/ninja.ps1")
- - Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab;$env:PATH"
+ - . .gitlab/ci/ninja-env.ps1
- (& "$env:WIX\bin\light.exe" -help) | Select -First 1
- cmake --version
- - ninja --version
- cmake -P .gitlab/ci/download_qt.cmake
- Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\qt\bin;$env:PATH"
- cmake -P .gitlab/ci/download_python3.cmake
@@ -397,11 +395,10 @@
script:
- . .gitlab/ci/env.ps1
- - $pwdpath = $pwd.Path
- - (& "$pwsh" -File ".gitlab/ci/ninja.ps1")
- - Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab;$env:PATH"
+ - . .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"
- build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_standalone.cmake