@@ -26,9 +26,8 @@ Function Get-LibrariesFromConfig {
2626 $jsonPath = [System.IO.Path ]::Combine($PSScriptRoot , ' ..\config\vs.json' )
2727 }
2828 process {
29- $jsonData = (
30- Get-File - Url " https://downloads.php.net/~windows/pecl/deps/libmapping.json"
31- ).Content | ConvertFrom-Json
29+ $jsonDataContent = (Get-File - Url " https://downloads.php.net/~windows/pecl/deps/libmapping.json" ).Content
30+ $jsonData = $jsonDataContent | ConvertFrom-Json
3231
3332 $phpSeries = (Get-File - Url " https://downloads.php.net/~windows/php-sdk/deps/$VsVersion /$Arch " ).Content.ToLower()
3433
@@ -61,6 +60,17 @@ Function Get-LibrariesFromConfig {
6160 return $null
6261 }
6362
63+ Function Test-Library {
64+ param (
65+ [Parameter (Mandatory = $true , Position = 0 )]
66+ [string ]$library
67+ )
68+ if ($jsonDataContent.Contains (" `" $library -" ) -or $phpSeries.Contains (" `" $library -" ) -or $jsonDataContent.Contains (" `" lib$library -" ) -or $phpSeries.Contains (" `" lib$library -" )) {
69+ return $library
70+ }
71+ return $null
72+ }
73+
6474 $jsonContent = Get-Content - Path $jsonPath - Raw
6575 $VsConfig = ConvertFrom-Json - InputObject $jsonContent
6676 $VsVersions = @ ($VsVersion )
@@ -71,19 +81,20 @@ Function Get-LibrariesFromConfig {
7181
7282 $foundItems = @ ()
7383 $libraryFilesFound = @ ()
74- [regex ]::Matches($ConfigW32Content , ' CHECK_LIB\(["'' ]([^"'' ]+)["'' ]|["'' ]([^"'' ]+\.lib)["'' ]|(\w+\.lib)|(SETUP_\w+)' ) | ForEach-Object {
75- $_.Groups [1 ].Value.Split(' ;' ) + ($_.Groups [2 ].Value -Split ' [^\w\.]' ) + ($_.Groups [3 ].Value -Split ' [^\w\.]' ) + ($_.Groups [4 ].Value) | ForEach-Object {
84+ [regex ]::Matches($ConfigW32Content , ' CHECK_LIB\(["'' ]([^"'' ]+)["'' ]|["'' ]([^"'' ]+\.lib)["'' ]|(\w+\.lib)|(\w+\slib)|( SETUP_\w+)' ) | ForEach-Object {
85+ $_.Groups [1 ].Value.Split(' ;' ) + ($_.Groups [2 ].Value -Split ' [^\w\.]' ) + ($_.Groups [3 ].Value -Split ' [^\w\.]' ) + ($_.Groups [4 ].Value) + ( $_ .Groups [ 5 ].Value) | ForEach-Object {
7686 $libraryFilesFound += $_
7787 }
7888 }
7989 $libraryFilesFound | Select-Object - Unique | ForEach-Object {
8090 if ($_ ) {
81- switch ($_ ) {
91+ switch - Wildcard ($_ ) {
8292 SETUP_ZLIB_LIB { $library = " zlib" }
8393 SETUP_OPENSSL { $library = " openssl" }
8494 SETUP_SQLITE3 { $library = " sqlite" }
8595 libeay32.lib { $library = " openssl" }
8696 ssleay32.lib { $library = " openssl" }
97+ " * lib" { $library = Test-Library $_.Replace (" lib" , " " ) }
8798 Default { $library = Find-Library $_ $VsVersions }
8899 }
89100 if ($library -and (-not ($foundItems.Contains ($library )))) {
@@ -102,6 +113,9 @@ Function Get-LibrariesFromConfig {
102113 if ($Extension -eq " memcached" -or $Extension -eq " xlswriter" ) {
103114 $foundItems += " zlib"
104115 }
116+ if ($ConfigW32Content.Contains (" boost" )) {
117+ $foundItems += " boost"
118+ }
105119 if ($Extension -eq " oci8_19" -or $Extension -eq " pdo_oci" ) {
106120 $foundItems += " instantclient"
107121 }
0 commit comments