Skip to content

Commit 1d19f7e

Browse files
authored
Update Add-Extension.ps1
1 parent 804f949 commit 1d19f7e

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

extension/BuildPhpExtension/private/Add-Extension.ps1

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,31 +37,22 @@ Function Add-Extension {
3737

3838
$configW32Content = [string](Get-Content -Path "config.w32")
3939
$arguments = Get-ArgumentsFromConfig $Extension $configW32Content
40-
41-
42-
$configstmp = @{}
43-
$configstmp.options = @()
44-
40+
$cfgoptions = ""
4541
foreach ($argument in $arguments) {
4642
if ([string]::IsNullOrWhiteSpace($argument)) { continue }
47-
$argumentKey = ($argument -split '=', 2)[0]
48-
49-
if ($null -ne $argument -and -not ($configstmp.options.Contains($argumentKey))) {
50-
$configstmp.options += $argument
51-
}
43+
$argumentKey = ($argument -split '=', 2)[0]
44+
if ($null -ne $argument -and -not ($cfgoptions.Contains($argumentKey))) {
45+
$cfgoptions += " $argument"
46+
}
5247
}
53-
54-
55-
$cfgoptionsStr = ($configstmp.options -join ' ')
56-
5748
$bat_content = @()
5849
$bat_content += ""
5950
$bat_content += "call phpize 2>&1"
60-
Write-Host "ARGUMENTS: $cfgoptionsStr"
51+
Write-Host "ARGUMENTS: $cfgoptions"
6152
if($Config.php_version -eq '7.2') {
62-
$bat_content += "call configure `"--with-php-build=..\deps`" $cfgoptionsStr `"--with-mp=disable`" `"--with-prefix=$Prefix`" 2>&1"
53+
$bat_content += "call configure `"--with-php-build=..\deps`" $cfgoptions `"--with-mp=disable`" `"--with-prefix=$Prefix`" 2>&1"
6354
} else {
64-
$bat_content += "call configure `"--with-php-build=..\deps`" $cfgoptionsStr `"--with-mp=disable`" `"--enable-native-intrinsics=sse2,ssse3,sse4.1,sse4.2`" `"--with-prefix=$Prefix`" 2>&1"
55+
$bat_content += "call configure `"--with-php-build=..\deps`" $cfgoptions `"--with-mp=disable`" `"--enable-native-intrinsics=sse2,ssse3,sse4.1,sse4.2`" `"--with-prefix=$Prefix`" 2>&1"
6556
}
6657

6758
$bat_content += "nmake /nologo 2>&1"

0 commit comments

Comments
 (0)