Avoid error when powershell isn't found in path (#37188)

Previously the REQUIRED flag made CMake fail with an error if
`powershell` wasn't found on line 193. This prevented the `else` block
on lines 197-198 from ever running.
This commit is contained in:
Abe Fettig 2024-03-08 01:40:36 -05:00 committed by GitHub
parent ca00cb2cbf
commit 7502ccb84c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -190,7 +190,7 @@ function(z_vcpkg_set_powershell_path)
set(Z_VCPKG_POWERSHELL_PATH "${Z_VCPKG_PWSH_PATH}" CACHE INTERNAL "The path to the PowerShell implementation to use.")
else()
message(DEBUG "vcpkg: Could not find PowerShell Core; falling back to PowerShell")
find_program(Z_VCPKG_BUILTIN_POWERSHELL_PATH powershell REQUIRED)
find_program(Z_VCPKG_BUILTIN_POWERSHELL_PATH powershell)
if(Z_VCPKG_BUILTIN_POWERSHELL_PATH)
set(Z_VCPKG_POWERSHELL_PATH "${Z_VCPKG_BUILTIN_POWERSHELL_PATH}" CACHE INTERNAL "The path to the PowerShell implementation to use.")
else()