File tree Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change 77jobs :
88 vs16 :
99 name : build_vs16
10- runs-on : windows-2019
10+ runs-on : windows-2022
1111 strategy :
1212 fail-fast : false
1313 matrix :
Original file line number Diff line number Diff line change @@ -197,6 +197,32 @@ Function Get-PHPBranch() {
197197 return $php_branch
198198}
199199
200+ Function Get-VSToolset () {
201+ $toolsets = @ {
202+ " vc14" = " 14.0"
203+ }
204+ $MSVCDirectory = vswhere - latest - products * - find " VC\Tools\MSVC"
205+ foreach ($toolset in (Get-ChildItem $MSVCDirectory )) {
206+ $major , $minor = $toolset.Name.split (" ." )[0 , 1 ]
207+ if (14 -eq $major ) {
208+ if (9 -ge $minor ) {
209+ $toolsets ." vc14" = $toolset
210+ } elseif (19 -ge $minor ) {
211+ $toolsets ." vc15" = $toolset
212+ } elseif (29 -ge $minor ) {
213+ $toolsets ." vs16" = $toolset
214+ } else {
215+ $toolsets ." vs17" = $toolset
216+ }
217+ }
218+ }
219+ $toolset = $toolsets .$vs
220+ if (-not $toolset ) {
221+ throw " No toolset found for $vs "
222+ }
223+ return $toolset.Name
224+ }
225+
200226Function Build-Extension () {
201227 $ts_path = Get-TSPath
202228 $package_zip = " php-devel-pack-$php_version$ts_path -Win32-$vs -$arch .zip"
@@ -210,7 +236,7 @@ Function Build-Extension() {
210236 $env: PATH = " $cache_dir \$package_dir ;$env: PATH "
211237 $builder = " $cache_dir \php-sdk-$sdk_version \phpsdk-$vs -$arch .bat"
212238 $task = (Get-Item - Path " ." - Verbose).FullName + ' \task.bat'
213- & $builder - t $task
239+ & $builder - s ( Get-VSToolset ) - t $task
214240}
215241
216242Function Copy-Extension () {
You can’t perform that action at this time.
0 commit comments