summaryrefslogtreecommitdiffstats
path: root/.appveyor
diff options
context:
space:
mode:
authorN00byKing <N00byKing@users.noreply.github.com>2018-01-18 10:55:56 +0100
committerN00byKing <N00byKing@hotmail.de>2018-02-24 13:08:46 +0100
commitc875a7984e373f78b733e7ceab66ac9faceca352 (patch)
tree4f60d321d8e0022b1290884e6fdb892456730b3a /.appveyor
parentMerge pull request #84 from lioncash/cmake (diff)
downloadyuzu-c875a7984e373f78b733e7ceab66ac9faceca352.tar
yuzu-c875a7984e373f78b733e7ceab66ac9faceca352.tar.gz
yuzu-c875a7984e373f78b733e7ceab66ac9faceca352.tar.bz2
yuzu-c875a7984e373f78b733e7ceab66ac9faceca352.tar.lz
yuzu-c875a7984e373f78b733e7ceab66ac9faceca352.tar.xz
yuzu-c875a7984e373f78b733e7ceab66ac9faceca352.tar.zst
yuzu-c875a7984e373f78b733e7ceab66ac9faceca352.zip
Diffstat (limited to '.appveyor')
-rw-r--r--.appveyor/UtilityFunctions.ps139
1 files changed, 39 insertions, 0 deletions
diff --git a/.appveyor/UtilityFunctions.ps1 b/.appveyor/UtilityFunctions.ps1
new file mode 100644
index 000000000..fd7476314
--- /dev/null
+++ b/.appveyor/UtilityFunctions.ps1
@@ -0,0 +1,39 @@
+# Set-up Visual Studio Command Prompt environment for PowerShell
+pushd "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\"
+cmd /c "VsDevCmd.bat -arch=x64 & set" | foreach {
+ if ($_ -match "=") {
+ $v = $_.split("="); Set-Item -Force -Path "ENV:\$($v[0])" -Value "$($v[1])"
+ }
+}
+popd
+
+function Which ($search_path, $name) {
+ ($search_path).Split(";") | Get-ChildItem -Filter $name | Select -First 1 -Exp FullName
+}
+
+function GetDeps ($search_path, $binary) {
+ ((dumpbin /dependents $binary).Where({ $_ -match "dependencies:"}, "SkipUntil") | Select-String "[^ ]*\.dll").Matches | foreach {
+ Which $search_path $_.Value
+ }
+}
+
+function RecursivelyGetDeps ($search_path, $binary) {
+ $final_deps = @()
+ $deps_to_process = GetDeps $search_path $binary
+ while ($deps_to_process.Count -gt 0) {
+ $current, $deps_to_process = $deps_to_process
+ if ($final_deps -contains $current) { continue }
+
+ # Is this a system dll file?
+ # We use the same algorithm that cmake uses to determine this.
+ if ($current -match "$([regex]::Escape($env:SystemRoot))\\sys") { continue }
+ if ($current -match "$([regex]::Escape($env:WinDir))\\sys") { continue }
+ if ($current -match "\\msvc[^\\]+dll") { continue }
+ if ($current -match "\\api-ms-win-[^\\]+dll") { continue }
+
+ $final_deps += $current
+ $new_deps = GetDeps $search_path $current
+ $deps_to_process += ($new_deps | ?{-not ($final_deps -contains $_)})
+ }
+ return $final_deps
+}