From 75fa1b2cde496421d203e9f0870b23bea3d6111a Mon Sep 17 00:00:00 2001 From: MerryMage Date: Fri, 1 Dec 2017 18:59:56 +0000 Subject: [PATCH] appveyor: Generate PDBs for mingw build --- ...lityFunctions.ps1 => FindDependencies.ps1} | 0 .appveyor/ProcessPdb.ps1 | 39 +++++++++++++++++++ CMakeLists.txt | 1 + appveyor.yml | 23 ++++++----- 4 files changed, 54 insertions(+), 9 deletions(-) rename .appveyor/{UtilityFunctions.ps1 => FindDependencies.ps1} (100%) create mode 100644 .appveyor/ProcessPdb.ps1 diff --git a/.appveyor/UtilityFunctions.ps1 b/.appveyor/FindDependencies.ps1 similarity index 100% rename from .appveyor/UtilityFunctions.ps1 rename to .appveyor/FindDependencies.ps1 diff --git a/.appveyor/ProcessPdb.ps1 b/.appveyor/ProcessPdb.ps1 new file mode 100644 index 0000000000..16a7243f38 --- /dev/null +++ b/.appveyor/ProcessPdb.ps1 @@ -0,0 +1,39 @@ +# Generate pdb files for mingw +if ($env:BUILD_TYPE -eq 'mingw') { + Invoke-WebRequest -Uri https://raw.githubusercontent.com/citra-emu/ext-windows-bin/master/cv2pdb/cv2pdb.exe -OutFile cv2pdb.exe + foreach ($exe in Get-ChildItem "$RELEASE_DIST" -Recurse -Filter "citra*.exe") { + .\cv2pdb $exe.FullName + } +} + +# Specify source locations in pdb via srcsrv.ini +$srcsrv = "SRCSRV: ini ------------------------------------------------`r`n" +$srcsrv += "VERSION=2`r`n" +$srcsrv += "VERCTRL=http`r`n" +$srcsrv += "SRCSRV: variables ------------------------------------------`r`n" +$srcsrv += "SRCSRVTRG=https://raw.githubusercontent.com/%var2%/%var3%/%var4%`r`n" +$srcsrv += "SRCSRV: source files ---------------------------------------`r`n" +foreach ($repo in @{ + "citra-emu/citra" = "" + "citra-emu/ext-boost" = "externals/boost" + "citra-emu/ext-soundtouch" = "externals/soundtouch" + "fmtlib/fmt" = "externals/fmt" + "herumi/xbyak" = "externals/xbyak" + "lsalzman/enet" = "externals/enet" + "MerryMage/dynarmic" = "externals/dynarmic" + "neobrain/nihstro" = "externals/nihstro" +}.GetEnumerator()) { + pushd + cd $repo.Value + $rev = git rev-parse HEAD + $files = git ls-tree --name-only --full-tree -r HEAD + foreach ($file in $files) { + $srcsrv += "$(pwd)\$($file -replace '/','\')*$($repo.Name)*$rev*$file`r`n" + } + popd +} +$srcsrv += "SRCSRV: end ------------------------------------------------`r`n" +Set-Content -Path srcsrv.ini -Value $srcsrv +foreach ($pdb in Get-ChildItem "$RELEASE_DIST" -Recurse -Filter "*.pdb") { + & "C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\srcsrv\pdbstr.exe" -w -i:srcsrv.ini -p:$pdb.FullName -s:srcsrv +} diff --git a/CMakeLists.txt b/CMakeLists.txt index f88e078a88..d587e9c1bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,6 +91,7 @@ if (NOT MSVC) if (MINGW) add_definitions(-DMINGW_HAS_SECURE_API) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gdwarf") if (MINGW_STATIC_BUILD) add_definitions(-DQT_STATICPLUGIN) diff --git a/appveyor.yml b/appveyor.yml index c2d1bf92ad..daec1e3de7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -82,26 +82,26 @@ after_build: $env:BUILD_SYMBOLS = $MSVC_BUILD_PDB $env:BUILD_UPDATE = $MSVC_SEVENZIP - 7z a -tzip $MSVC_BUILD_PDB .\msvc_build\bin\release\*.pdb - rm .\msvc_build\bin\release\*.pdb - mkdir $RELEASE_DIST Copy-Item .\msvc_build\bin\release\* -Destination $RELEASE_DIST -Recurse Copy-Item .\license.txt -Destination $RELEASE_DIST Copy-Item .\README.md -Destination $RELEASE_DIST + + # process PDBs + . "./.appveyor/ProcessPdb.ps1" + 7z a -tzip $MSVC_BUILD_PDB $RELEASE_DIST\*.pdb + rm $RELEASE_DIST\*.pdb + 7z a -tzip $MSVC_BUILD_ZIP $RELEASE_DIST\* 7z a $MSVC_SEVENZIP $RELEASE_DIST } else { $MINGW_BUILD_ZIP = "citra-windows-mingw-$GITDATE-$GITREV.zip" -replace " ", "" + $MINGW_BUILD_PDB = "citra-windows-mingw-$GITDATE-$GITREV-debugsymbols.zip" -replace " ", "" $MINGW_SEVENZIP = "citra-windows-mingw-$GITDATE-$GITREV.7z" -replace " ", "" - # not going to bother adding separate debug symbols for mingw, so just upload a README for it - # if someone wants to add them, change mingw to compile with -g and use objdump and strip to separate the symbols from the binary - $MINGW_NO_DEBUG_SYMBOLS = "README_No_Debug_Symbols.txt" - Set-Content -Path $MINGW_NO_DEBUG_SYMBOLS -Value "This is a workaround for Appveyor since msvc has debug symbols but mingw doesnt" -Force # store the build information in env vars so we can use them as artifacts $env:BUILD_ZIP = $MINGW_BUILD_ZIP - $env:BUILD_SYMBOLS = $MINGW_NO_DEBUG_SYMBOLS + $env:BUILD_SYMBOLS = $MINGW_BUILD_PDB $env:BUILD_UPDATE = $MINGW_SEVENZIP $CMAKE_SOURCE_DIR = "$env:APPVEYOR_BUILD_FOLDER" @@ -117,7 +117,7 @@ after_build: Copy-Item -path "$CMAKE_SOURCE_DIR/README.md" -destination $RELEASE_DIST # copy all the dll dependencies to the release folder - . "./.appveyor/UtilityFunctions.ps1" + . "./.appveyor/FindDependencies.ps1" $DLLSearchPath = "C:\msys64\mingw64\bin;$env:PATH" $MingwDLLs = RecursivelyGetDeps $DLLSearchPath "$RELEASE_DIST\citra.exe" $MingwDLLs += RecursivelyGetDeps $DLLSearchPath "$RELEASE_DIST\citra-qt.exe" @@ -130,6 +130,11 @@ after_build: # copy the qt windows plugin dll to platforms Copy-Item -path "C:/msys64/mingw64/share/qt5/plugins/platforms/qwindows.dll" -force -destination "$RELEASE_DIST/platforms" + # process PDBs + . "./.appveyor/ProcessPdb.ps1" + 7z a -tzip $MINGW_BUILD_PDB $RELEASE_DIST\*.pdb + rm $RELEASE_DIST\*.pdb + 7z a -tzip $MINGW_BUILD_ZIP $RELEASE_DIST\* 7z a $MINGW_SEVENZIP $RELEASE_DIST }