[CI] Look for pwsh in addition to powerhsell (#1239)

Newer github actions bot setup no longer include a powershell.exe
binary, only pwsh.exe
This commit is contained in:
Fabrice de Gans 2024-03-10 15:58:25 -07:00 committed by GitHub
parent 85b7cf7aec
commit f17a9855f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 13 deletions

View File

@ -52,6 +52,15 @@ set(VCPKG_DEPS_OPTIONAL
ffmpeg ENABLE_FFMPEG
)
if(WIN32)
find_program(POWERSHELL
NAMES powershell.exe pwsh.exe
HINTS "/Windows/System32/WindowsPowerShell/v1.0"
REQUIRED)
else()
find_program(powershell pwsh REQUIRED)
endif()
include(Set-Toolchain-vcpkg)
set(VBAM_STATIC_DEFAULT OFF)

View File

@ -277,12 +277,6 @@ function(get_binary_packages vcpkg_exe)
FetchContent_Populate(vcpkg_binpkg)
endif()
if(WIN32)
find_program(powershell powershell.exe HINTS "/Windows/System32/WindowsPowerShell/v1.0" REQUIRED)
else()
find_program(powershell pwsh REQUIRED)
endif()
unset(to_install)
foreach(pkg ${binary_packages})
if(NOT pkg MATCHES "([^_]+)_([^_]+)_([^.]+)[.]zip")
@ -292,7 +286,7 @@ function(get_binary_packages vcpkg_exe)
set(pkg_version ${CMAKE_MATCH_2})
set(pkg_triplet ${CMAKE_MATCH_3})
vcpkg_is_installed(${vcpkg_exe} ${pkg_name} ${pkg_version} ${pkg_triplet} ${powershell} pkg_installed)
vcpkg_is_installed(${vcpkg_exe} ${pkg_name} ${pkg_version} ${pkg_triplet} ${POWERSHELL} pkg_installed)
if(NOT pkg_installed)
list(APPEND to_install ${pkg})

View File

@ -94,12 +94,6 @@ if (WIN32)
add_definitions(-D_UNICODE -DUNICODE -DwxUSE_GUI=1 -D__WXMSW__ -DWINVER=0x0A00 -DNTDDI_VERSION=0x0A000007)
endif()
if(CMAKE_HOST_WIN32)
find_program(POWERSHELL powershell.exe HINTS "/Windows/System32/WindowsPowerShell/v1.0" REQUIRED)
else()
find_program(POWERSHELL pwsh)
endif()
find_program(ZIP_PROGRAM zip)
if(ZIP_PROGRAM)
set(ZIP_PROGRAM "${ZIP_PROGRAM}" CACHE STRING "zip compressor executable" FORCE)