summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bunnei2018-03-26 19:15:39 -0400
committerGravatar GitHub2018-03-26 19:15:39 -0400
commit010ea89013d1c2fb30c2368b3fc56dcbbb7eaa48 (patch)
tree51736e0ccf202076ececbc62905dffe9a76a9d15
parentMerge pull request #280 from bunnei/misc-service-fixes (diff)
parentImplement Citra pull 3043 (diff)
downloadyuzu-010ea89013d1c2fb30c2368b3fc56dcbbb7eaa48.tar.gz
yuzu-010ea89013d1c2fb30c2368b3fc56dcbbb7eaa48.tar.xz
yuzu-010ea89013d1c2fb30c2368b3fc56dcbbb7eaa48.zip
Merge pull request #102 from N00byKing/master
Implement Pull #3043 from citra: appveyor: Determine dlls to include in package programmatically
-rw-r--r--.appveyor/UtilityFunctions.ps139
-rw-r--r--appveyor.yml23
2 files changed, 47 insertions, 15 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 @@
1# Set-up Visual Studio Command Prompt environment for PowerShell
2pushd "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\"
3cmd /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}
8popd
9
10function Which ($search_path, $name) {
11 ($search_path).Split(";") | Get-ChildItem -Filter $name | Select -First 1 -Exp FullName
12}
13
14function 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
20function 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}
diff --git a/appveyor.yml b/appveyor.yml
index fe6b649f5..72cda26a7 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -121,23 +121,16 @@ after_build:
121 Get-ChildItem "$CMAKE_BINARY_DIR" -Filter "yuzu*.exe" | Copy-Item -destination $RELEASE_DIST 121 Get-ChildItem "$CMAKE_BINARY_DIR" -Filter "yuzu*.exe" | Copy-Item -destination $RELEASE_DIST
122 Copy-Item -path "$CMAKE_SOURCE_DIR/license.txt" -destination $RELEASE_DIST 122 Copy-Item -path "$CMAKE_SOURCE_DIR/license.txt" -destination $RELEASE_DIST
123 Copy-Item -path "$CMAKE_SOURCE_DIR/README.md" -destination $RELEASE_DIST 123 Copy-Item -path "$CMAKE_SOURCE_DIR/README.md" -destination $RELEASE_DIST
124
124 # copy all the dll dependencies to the release folder 125 # copy all the dll dependencies to the release folder
125 # hardcoded list because we don't build static and determining the list of dlls from the binary is a pain. 126 . "./.appveyor/UtilityFunctions.ps1"
126 $MingwDLLs = "Qt5Core.dll","Qt5Widgets.dll","Qt5Gui.dll","Qt5OpenGL.dll", 127 $DLLSearchPath = "C:\msys64\mingw64\bin;$env:PATH"
127 # QT dll dependencies 128 $MingwDLLs = RecursivelyGetDeps $DLLSearchPath "$RELEASE_DIST\yuzu.exe"
128 "libbz2-*.dll","libicudt*.dll","libicuin*.dll","libicuuc*.dll","libffi-*.dll", 129 $MingwDLLs += RecursivelyGetDeps $DLLSearchPath "$RELEASE_DIST\yuzu_cmd.exe"
129 "libfreetype-*.dll","libglib-*.dll","libgobject-*.dll","libgraphite2.dll","libiconv-*.dll", 130 Write-Host "Detected the following dependencies:"
130 "libharfbuzz-*.dll","libintl-*.dll","libpcre-*.dll","libpcre2-16-*.dll","libpcre16-*.dll","libpng16-*.dll", 131 Write-Host $MingwDLLs
131 # Runtime/Other dependencies
132 "libgcc_s_seh-*.dll","libstdc++-*.dll","libwinpthread-*.dll","SDL2.dll","zlib1.dll"
133 foreach ($file in $MingwDLLs) { 132 foreach ($file in $MingwDLLs) {
134 Copy-Item -path "C:/msys64/mingw64/bin/$file" -force -destination "$RELEASE_DIST" 133 Copy-Item -path "$file" -force -destination "$RELEASE_DIST"
135 }
136 # the above list copies a few extra debug dlls that aren't needed (thanks globbing patterns!)
137 # so we can remove them by hardcoding another list of extra dlls to remove
138 $DebugDLLs = "libicudtd*.dll","libicuind*.dll","libicuucd*.dll"
139 foreach ($file in $DebugDLLs) {
140 Remove-Item -path "$RELEASE_DIST/$file"
141 } 134 }
142 135
143 # copy the qt windows plugin dll to platforms 136 # copy the qt windows plugin dll to platforms