File tree Expand file tree Collapse file tree 6 files changed +38
-19
lines changed
extension/BuildPhpExtension Expand file tree Collapse file tree 6 files changed +38
-19
lines changed Original file line number Diff line number Diff line change 10
10
"type" : " self-hosted"
11
11
},
12
12
"7.2" : {
13
- "vs" : " 2017 " ,
14
- "os" : " windows-2016 " ,
15
- "type" : " self -hosted"
13
+ "vs" : " 2019 " ,
14
+ "os" : " windows-2019 " ,
15
+ "type" : " github -hosted"
16
16
},
17
17
"7.3" : {
18
- "vs" : " 2017 " ,
19
- "os" : " windows-2016 " ,
20
- "type" : " self -hosted"
18
+ "vs" : " 2019 " ,
19
+ "os" : " windows-2019 " ,
20
+ "type" : " github -hosted"
21
21
},
22
22
"7.4" : {
23
- "vs" : " 2017 " ,
24
- "os" : " windows-2016 " ,
25
- "type" : " self -hosted"
23
+ "vs" : " 2019 " ,
24
+ "os" : " windows-2019 " ,
25
+ "type" : " github -hosted"
26
26
},
27
27
"8.0" : {
28
28
"vs" : " 2019" ,
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ function Add-BuildRequirements {
14
14
Extension Thread Safety
15
15
. PARAMETER VsVersion
16
16
Visual Studio version
17
+ . PARAMETER VsToolset
18
+ Visual Studio toolset
17
19
#>
18
20
[OutputType ()]
19
21
param (
@@ -40,7 +42,11 @@ function Add-BuildRequirements {
40
42
[Parameter (Mandatory = $true , Position = 5 , HelpMessage = ' Visual Studio version' )]
41
43
[ValidateNotNull ()]
42
44
[ValidateLength (1 , [int ]::MaxValue)]
43
- [string ] $VsVersion
45
+ [string ] $VsVersion ,
46
+ [Parameter (Mandatory = $true , Position = 6 , HelpMessage = ' Visual Studio toolset' )]
47
+ [ValidateNotNull ()]
48
+ [ValidateLength (1 , [int ]::MaxValue)]
49
+ [string ] $VsToolset
44
50
)
45
51
begin {
46
52
}
@@ -51,7 +57,8 @@ function Add-BuildRequirements {
51
57
- PhpVersion $PhpVersion `
52
58
- Arch $Arch `
53
59
- Ts $Ts `
54
- - VsVersion $VsVersion
60
+ - VsVersion $VsVersion `
61
+ - VsToolset $VsToolset
55
62
$prefix = Get-PhpBuild - Config $config
56
63
Get-PhpDevelBuild - Config $config
57
64
Add-Dependencies - Config $config - Prefix $prefix
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ Function Get-ExtensionConfig {
14
14
Extension Thread Safety
15
15
. PARAMETER VsVersion
16
16
Visual Studio version
17
+ . PARAMETER VsToolset
18
+ Visual Studio toolset
17
19
#>
18
20
[OutputType ()]
19
21
param (
@@ -40,7 +42,11 @@ Function Get-ExtensionConfig {
40
42
[Parameter (Mandatory = $true , Position = 5 , HelpMessage = ' Visual Studio version' )]
41
43
[ValidateNotNull ()]
42
44
[ValidateLength (1 , [int ]::MaxValue)]
43
- [string ] $VsVersion
45
+ [string ] $VsVersion ,
46
+ [Parameter (Mandatory = $true , Position = 6 , HelpMessage = ' Visual Studio toolset' )]
47
+ [ValidateNotNull ()]
48
+ [ValidateLength (1 , [int ]::MaxValue)]
49
+ [string ] $VsToolset
44
50
)
45
51
begin {
46
52
}
@@ -62,6 +68,7 @@ Function Get-ExtensionConfig {
62
68
arch = $Arch
63
69
ts = $Ts
64
70
vs_version = $VsVersion
71
+ vs_toolset = $VsToolset
65
72
options = @ ()
66
73
php_libraries = @ ()
67
74
extension_libraries = @ ()
Original file line number Diff line number Diff line change @@ -25,21 +25,25 @@ function Get-VsVersion {
25
25
throw " vswhere is not available"
26
26
}
27
27
$MSVCDirectory = vswhere - latest - find " VC\Tools\MSVC"
28
- $toolset = $null
28
+ $selectedToolset = $null
29
+ $minor = $null
29
30
foreach ($toolset in (Get-ChildItem $MSVCDirectory )) {
30
31
$toolsetMajorVersion , $toolsetMinorVersion = $toolset.Name.split (" ." )[0 , 1 ]
31
32
$requiredVs = $VsConfig.vs .$VsVersion
32
33
if ($requiredVs.major -eq $toolsetMajorVersion -and ($null -eq $requiredVs.minor -or $toolsetMinorVersion -le $requiredVs.minor )) {
33
- $toolset = $toolset.Name
34
- break
34
+ if ($null -eq $minor -or $toolsetMinorVersion -gt $minor )
35
+ {
36
+ $selectedToolset = $toolset.Name.Trim ()
37
+ $minor = $toolsetMinorVersion
38
+ }
35
39
}
36
40
}
37
- if (-not $toolset ) {
41
+ if (-not $selectedToolset ) {
38
42
throw " toolset not available"
39
43
}
40
44
return [PSCustomObject ]@ {
41
45
vs = $VsVersion
42
- toolset = $toolset
46
+ toolset = $selectedToolset
43
47
}
44
48
}
45
49
end {
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ Function Invoke-Build {
31
31
$Config.vs_version ,
32
32
$Config.arch
33
33
) -join " -" )
34
- & $builder - t $task | Tee-Object - FilePath " build-$suffix .txt"
34
+ & $builder - s $Config .vs_toolset - t $task | Tee-Object - FilePath " build-$suffix .txt"
35
35
}
36
36
end {
37
37
}
Original file line number Diff line number Diff line change @@ -58,7 +58,8 @@ function Invoke-PhpBuildExtension {
58
58
- PhpVersion $PhpVersion `
59
59
- Arch $Arch `
60
60
- Ts $Ts `
61
- - VsVersion $VsData.vs
61
+ - VsVersion $VsData.vs `
62
+ - VsToolset $VsData.toolset
62
63
63
64
Invoke-Build - Config $config
64
65
You can’t perform that action at this time.
0 commit comments