diff options
| -rw-r--r-- | .appveyor/UtilityFunctions.ps1 | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/.appveyor/UtilityFunctions.ps1 b/.appveyor/UtilityFunctions.ps1 deleted file mode 100644 index fd7476314..000000000 --- a/.appveyor/UtilityFunctions.ps1 +++ /dev/null | |||
| @@ -1,39 +0,0 @@ | |||
| 1 | # Set-up Visual Studio Command Prompt environment for PowerShell | ||
| 2 | pushd "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\" | ||
| 3 | cmd /c "VsDevCmd.bat -arch=x64 & set" | foreach { | ||
| 4 | if ($_ -match "=") { | ||
| 5 | $v = $_.split("="); Set-Item -Force -Path "ENV:\$($v[0])" -Value "$($v[1])" | ||
| 6 | } | ||
| 7 | } | ||
| 8 | popd | ||
| 9 | |||
| 10 | function Which ($search_path, $name) { | ||
| 11 | ($search_path).Split(";") | Get-ChildItem -Filter $name | Select -First 1 -Exp FullName | ||
| 12 | } | ||
| 13 | |||
| 14 | function GetDeps ($search_path, $binary) { | ||
| 15 | ((dumpbin /dependents $binary).Where({ $_ -match "dependencies:"}, "SkipUntil") | Select-String "[^ ]*\.dll").Matches | foreach { | ||
| 16 | Which $search_path $_.Value | ||
| 17 | } | ||
| 18 | } | ||
| 19 | |||
| 20 | function RecursivelyGetDeps ($search_path, $binary) { | ||
| 21 | $final_deps = @() | ||
| 22 | $deps_to_process = GetDeps $search_path $binary | ||
| 23 | while ($deps_to_process.Count -gt 0) { | ||
| 24 | $current, $deps_to_process = $deps_to_process | ||
| 25 | if ($final_deps -contains $current) { continue } | ||
| 26 | |||
| 27 | # Is this a system dll file? | ||
| 28 | # We use the same algorithm that cmake uses to determine this. | ||
| 29 | if ($current -match "$([regex]::Escape($env:SystemRoot))\\sys") { continue } | ||
| 30 | if ($current -match "$([regex]::Escape($env:WinDir))\\sys") { continue } | ||
| 31 | if ($current -match "\\msvc[^\\]+dll") { continue } | ||
| 32 | if ($current -match "\\api-ms-win-[^\\]+dll") { continue } | ||
| 33 | |||
| 34 | $final_deps += $current | ||
| 35 | $new_deps = GetDeps $search_path $current | ||
| 36 | $deps_to_process += ($new_deps | ?{-not ($final_deps -contains $_)}) | ||
| 37 | } | ||
| 38 | return $final_deps | ||
| 39 | } | ||