1#!/bin/bash -ex
2
3cd /yuzu
4
5ccache -s
6
7mkdir build || true && cd build
8cmake .. -G Ninja -DDISPLAY_VERSION=$1 -DCMAKE_TOOLCHAIN_FILE="$(pwd)/../CMakeModules/MinGWCross.cmake" -DUSE_CCACHE=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_QT_TRANSLATION=ON
9ninja
10
11ccache -s
12
13echo "Tests skipped"
14#ctest -VV -C Release
15
16echo 'Prepare binaries...'
17cd ..
18mkdir package
19
20if [ -d "/usr/x86_64-w64-mingw32/lib/qt5/plugins/platforms/" ]; then
21  QT_PLATFORM_DLL_PATH='/usr/x86_64-w64-mingw32/lib/qt5/plugins/platforms/'
22else
23  #fallback to qt
24  QT_PLATFORM_DLL_PATH='/usr/x86_64-w64-mingw32/lib/qt/plugins/platforms/'
25fi
26
27find build/ -name "yuzu*.exe" -exec cp {} 'package' \;
28
29# copy Qt plugins
30mkdir package/platforms
31cp "${QT_PLATFORM_DLL_PATH}/qwindows.dll" package/platforms/
32cp -rv "${QT_PLATFORM_DLL_PATH}/../mediaservice/" package/
33cp -rv "${QT_PLATFORM_DLL_PATH}/../imageformats/" package/
34rm -f package/mediaservice/*d.dll
35
36for i in package/*.exe; do
37  # we need to process pdb here, however, cv2pdb
38  # does not work here, so we just simply strip all the debug symbols
39  x86_64-w64-mingw32-strip "${i}"
40done
41
42pip3 install pefile
43python3 .ci/scripts/windows/scan_dll.py package/*.exe "package/"
44python3 .ci/scripts/windows/scan_dll.py package/imageformats/*.dll "package/"
45