Merge pull request #102 from N00byKing/master
Implement Pull #3043 from citra: appveyor: Determine dlls to include in package programmatically
This commit is contained in:
commit
010ea89013
|
@ -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
|
||||||
|
}
|
23
appveyor.yml
23
appveyor.yml
|
@ -121,23 +121,16 @@ after_build:
|
||||||
Get-ChildItem "$CMAKE_BINARY_DIR" -Filter "yuzu*.exe" | Copy-Item -destination $RELEASE_DIST
|
Get-ChildItem "$CMAKE_BINARY_DIR" -Filter "yuzu*.exe" | Copy-Item -destination $RELEASE_DIST
|
||||||
Copy-Item -path "$CMAKE_SOURCE_DIR/license.txt" -destination $RELEASE_DIST
|
Copy-Item -path "$CMAKE_SOURCE_DIR/license.txt" -destination $RELEASE_DIST
|
||||||
Copy-Item -path "$CMAKE_SOURCE_DIR/README.md" -destination $RELEASE_DIST
|
Copy-Item -path "$CMAKE_SOURCE_DIR/README.md" -destination $RELEASE_DIST
|
||||||
|
|
||||||
# copy all the dll dependencies to the release folder
|
# copy all the dll dependencies to the release folder
|
||||||
# hardcoded list because we don't build static and determining the list of dlls from the binary is a pain.
|
. "./.appveyor/UtilityFunctions.ps1"
|
||||||
$MingwDLLs = "Qt5Core.dll","Qt5Widgets.dll","Qt5Gui.dll","Qt5OpenGL.dll",
|
$DLLSearchPath = "C:\msys64\mingw64\bin;$env:PATH"
|
||||||
# QT dll dependencies
|
$MingwDLLs = RecursivelyGetDeps $DLLSearchPath "$RELEASE_DIST\yuzu.exe"
|
||||||
"libbz2-*.dll","libicudt*.dll","libicuin*.dll","libicuuc*.dll","libffi-*.dll",
|
$MingwDLLs += RecursivelyGetDeps $DLLSearchPath "$RELEASE_DIST\yuzu_cmd.exe"
|
||||||
"libfreetype-*.dll","libglib-*.dll","libgobject-*.dll","libgraphite2.dll","libiconv-*.dll",
|
Write-Host "Detected the following dependencies:"
|
||||||
"libharfbuzz-*.dll","libintl-*.dll","libpcre-*.dll","libpcre2-16-*.dll","libpcre16-*.dll","libpng16-*.dll",
|
Write-Host $MingwDLLs
|
||||||
# Runtime/Other dependencies
|
|
||||||
"libgcc_s_seh-*.dll","libstdc++-*.dll","libwinpthread-*.dll","SDL2.dll","zlib1.dll"
|
|
||||||
foreach ($file in $MingwDLLs) {
|
foreach ($file in $MingwDLLs) {
|
||||||
Copy-Item -path "C:/msys64/mingw64/bin/$file" -force -destination "$RELEASE_DIST"
|
Copy-Item -path "$file" -force -destination "$RELEASE_DIST"
|
||||||
}
|
|
||||||
# the above list copies a few extra debug dlls that aren't needed (thanks globbing patterns!)
|
|
||||||
# so we can remove them by hardcoding another list of extra dlls to remove
|
|
||||||
$DebugDLLs = "libicudtd*.dll","libicuind*.dll","libicuucd*.dll"
|
|
||||||
foreach ($file in $DebugDLLs) {
|
|
||||||
Remove-Item -path "$RELEASE_DIST/$file"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# copy the qt windows plugin dll to platforms
|
# copy the qt windows plugin dll to platforms
|
||||||
|
|
Loading…
Reference in New Issue