diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 87cf754c79..92c48dded3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -161,6 +161,7 @@ jobs: run: | python -m pip install meson choco install ccache nasm + ./ci/install-cmake.ps1 -arch ${{ matrix.arch }} - name: Update Meson WrapDB run: | @@ -177,7 +178,7 @@ jobs: $env:PATH = ($env:PATH -split ';' | Where-Object { $_ -ne 'C:\Program Files\LLVM\bin' -and ` $_ -ne 'C:\Program Files\CMake\bin' -and ` $_ -ne 'C:\Strawberry\c\bin' }) -join ';' - $env:PATH += ';C:\Program Files\NASM' + $env:PATH = "$pwd\cmake\bin;" + $env:PATH + ';C:\Program Files\NASM' Import-Module "$env:VS\Common7\Tools\Microsoft.VisualStudio.DevShell.dll" Enter-VsDevShell -VsInstallPath $env:VS -SkipAutomaticLocation -DevCmdArguments "-arch=${{ matrix.arch }} -host_arch=${{ matrix.arch }}" ./ci/build-win32.ps1 @@ -193,7 +194,7 @@ jobs: $env:PATH = ($env:PATH -split ';' | Where-Object { $_ -ne 'C:\Program Files\LLVM\bin' -and ` $_ -ne 'C:\Program Files\CMake\bin' -and ` $_ -ne 'C:\Strawberry\c\bin' }) -join ';' - $env:PATH += ';C:\Program Files\NASM' + $env:PATH = "$pwd\cmake\bin;" + $env:PATH + ';C:\Program Files\NASM' Import-Module "$env:VS\Common7\Tools\Microsoft.VisualStudio.DevShell.dll" Enter-VsDevShell -VsInstallPath $env:VS -SkipAutomaticLocation -DevCmdArguments "-arch=${{ matrix.arch }} -host_arch=${{ matrix.arch }}" meson test -C build -t 2 diff --git a/ci/install-cmake.ps1 b/ci/install-cmake.ps1 new file mode 100644 index 0000000000..905487fdbf --- /dev/null +++ b/ci/install-cmake.ps1 @@ -0,0 +1,16 @@ +param( + [string]$arch, + [string]$version = "4.0.2" +) + +if ($arch -eq "x64") { + $arch = "x86_64" +} + +$cmake_fullname = "cmake-$version-windows-$arch" + +$cmake_url = "https://github.com/Kitware/CMake/releases/download/v$version/$cmake_fullname.zip" + +Invoke-WebRequest $cmake_url -OutFile .\$cmake_fullname.zip +Expand-Archive -Path .\$cmake_fullname.zip -DestinationPath .\ -Force +Rename-Item -Path .\$cmake_fullname -NewName cmake