diff options
| author | 2022-07-05 20:30:38 -0400 | |
|---|---|---|
| committer | 2022-07-05 20:30:38 -0400 | |
| commit | 770611fdf39f274ee9ccde9875e86cfeb79a3f6f (patch) | |
| tree | a580077f3b8f5ebbba6ee58ba594192f68ebdeea | |
| parent | Merge pull request #8532 from liamwhite/fiber-supplements (diff) | |
| parent | CI: unbreak ADO after GHA changes (diff) | |
| download | yuzu-770611fdf39f274ee9ccde9875e86cfeb79a3f6f.tar.gz yuzu-770611fdf39f274ee9ccde9875e86cfeb79a3f6f.tar.xz yuzu-770611fdf39f274ee9ccde9875e86cfeb79a3f6f.zip | |
Merge pull request #8486 from liushuyu/github-actions-verify
CI: Use GitHub Actions to validate pull requests
| -rwxr-xr-x | .ci/scripts/clang/docker.sh | 6 | ||||
| -rw-r--r-- | .ci/scripts/clang/exec.sh | 2 | ||||
| -rwxr-xr-x[-rw-r--r--] | .ci/scripts/clang/upload.sh | 0 | ||||
| -rw-r--r-- | .ci/scripts/common/post-upload.sh | 6 | ||||
| -rw-r--r-- | .ci/scripts/format/exec.sh | 2 | ||||
| -rwxr-xr-x | .ci/scripts/linux/docker.sh | 9 | ||||
| -rw-r--r-- | .ci/scripts/linux/exec.sh | 2 | ||||
| -rwxr-xr-x[-rw-r--r--] | .ci/scripts/linux/upload.sh | 5 | ||||
| -rwxr-xr-x | .ci/scripts/windows/docker.sh | 20 | ||||
| -rw-r--r-- | .ci/scripts/windows/exec.sh | 2 | ||||
| -rwxr-xr-x[-rw-r--r--] | .ci/scripts/windows/upload.sh | 0 | ||||
| -rw-r--r-- | .github/workflows/verify.yml | 115 | ||||
| -rw-r--r-- | CMakeLists.txt | 8 | ||||
| -rw-r--r-- | CMakeModules/CopyYuzuFFmpegDeps.cmake | 1 | ||||
| -rw-r--r-- | CMakeModules/MSVCCache.cmake | 12 | ||||
| -rw-r--r-- | src/CMakeLists.txt | 8 |
16 files changed, 174 insertions, 24 deletions
diff --git a/.ci/scripts/clang/docker.sh b/.ci/scripts/clang/docker.sh index 885d74e97..94a9ca0ec 100755 --- a/.ci/scripts/clang/docker.sh +++ b/.ci/scripts/clang/docker.sh | |||
| @@ -3,14 +3,12 @@ | |||
| 3 | # Exit on error, rather than continuing with the rest of the script. | 3 | # Exit on error, rather than continuing with the rest of the script. |
| 4 | set -e | 4 | set -e |
| 5 | 5 | ||
| 6 | cd /yuzu | ||
| 7 | |||
| 8 | ccache -s | 6 | ccache -s |
| 9 | 7 | ||
| 10 | mkdir build || true && cd build | 8 | mkdir build || true && cd build |
| 11 | cmake .. -DDISPLAY_VERSION=$1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/lib/ccache/clang -DCMAKE_CXX_COMPILER=/usr/lib/ccache/clang++ -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DUSE_DISCORD_PRESENCE=ON -DENABLE_QT_TRANSLATION=ON -DCMAKE_INSTALL_PREFIX="/usr" | 9 | cmake .. -GNinja -DDISPLAY_VERSION=$1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/lib/ccache/clang -DCMAKE_CXX_COMPILER=/usr/lib/ccache/clang++ -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DUSE_DISCORD_PRESENCE=ON -DENABLE_QT_TRANSLATION=ON -DCMAKE_INSTALL_PREFIX="/usr" |
| 12 | 10 | ||
| 13 | make -j$(nproc) | 11 | ninja |
| 14 | 12 | ||
| 15 | ccache -s | 13 | ccache -s |
| 16 | 14 | ||
diff --git a/.ci/scripts/clang/exec.sh b/.ci/scripts/clang/exec.sh index e56cd4325..a213aac27 100644 --- a/.ci/scripts/clang/exec.sh +++ b/.ci/scripts/clang/exec.sh | |||
| @@ -4,5 +4,5 @@ mkdir -p "ccache" || true | |||
| 4 | chmod a+x ./.ci/scripts/clang/docker.sh | 4 | chmod a+x ./.ci/scripts/clang/docker.sh |
| 5 | # the UID for the container yuzu user is 1027 | 5 | # the UID for the container yuzu user is 1027 |
| 6 | sudo chown -R 1027 ./ | 6 | sudo chown -R 1027 ./ |
| 7 | docker run -e ENABLE_COMPATIBILITY_REPORTING -e CCACHE_DIR=/yuzu/ccache -v $(pwd):/yuzu yuzuemu/build-environments:linux-fresh /bin/bash /yuzu/.ci/scripts/clang/docker.sh $1 | 7 | docker run -e ENABLE_COMPATIBILITY_REPORTING -e CCACHE_DIR=/yuzu/ccache -v "$(pwd):/yuzu" -w /yuzu yuzuemu/build-environments:linux-fresh /bin/bash /yuzu/.ci/scripts/clang/docker.sh "$1" |
| 8 | sudo chown -R $UID ./ | 8 | sudo chown -R $UID ./ |
diff --git a/.ci/scripts/clang/upload.sh b/.ci/scripts/clang/upload.sh index fe4e6b2ac..fe4e6b2ac 100644..100755 --- a/.ci/scripts/clang/upload.sh +++ b/.ci/scripts/clang/upload.sh | |||
diff --git a/.ci/scripts/common/post-upload.sh b/.ci/scripts/common/post-upload.sh index 387431564..a4e3070fd 100644 --- a/.ci/scripts/common/post-upload.sh +++ b/.ci/scripts/common/post-upload.sh | |||
| @@ -4,8 +4,10 @@ | |||
| 4 | cp license.txt "$DIR_NAME" | 4 | cp license.txt "$DIR_NAME" |
| 5 | cp README.md "$DIR_NAME" | 5 | cp README.md "$DIR_NAME" |
| 6 | 6 | ||
| 7 | tar -cJvf "${REV_NAME}-source.tar.xz" src externals CMakeLists.txt README.md license.txt | 7 | if [[ -z "${NO_SOURCE_PACK}" ]]; then |
| 8 | cp "${REV_NAME}-source.tar.xz" "$DIR_NAME" | 8 | tar -cJvf "${REV_NAME}-source.tar.xz" src externals CMakeLists.txt README.md license.txt |
| 9 | cp -v "${REV_NAME}-source.tar.xz" "$DIR_NAME" | ||
| 10 | fi | ||
| 9 | 11 | ||
| 10 | tar $COMPRESSION_FLAGS "$ARCHIVE_NAME" "$DIR_NAME" | 12 | tar $COMPRESSION_FLAGS "$ARCHIVE_NAME" "$DIR_NAME" |
| 11 | 13 | ||
diff --git a/.ci/scripts/format/exec.sh b/.ci/scripts/format/exec.sh index e9e9d2e17..c50e90d66 100644 --- a/.ci/scripts/format/exec.sh +++ b/.ci/scripts/format/exec.sh | |||
| @@ -3,5 +3,5 @@ | |||
| 3 | chmod a+x ./.ci/scripts/format/docker.sh | 3 | chmod a+x ./.ci/scripts/format/docker.sh |
| 4 | # the UID for the container yuzu user is 1027 | 4 | # the UID for the container yuzu user is 1027 |
| 5 | sudo chown -R 1027 ./ | 5 | sudo chown -R 1027 ./ |
| 6 | docker run -v $(pwd):/yuzu yuzuemu/build-environments:linux-clang-format /bin/bash -ex /yuzu/.ci/scripts/format/docker.sh | 6 | docker run -v "$(pwd):/yuzu" -w /yuzu yuzuemu/build-environments:linux-clang-format /bin/bash -ex /yuzu/.ci/scripts/format/docker.sh |
| 7 | sudo chown -R $UID ./ | 7 | sudo chown -R $UID ./ |
diff --git a/.ci/scripts/linux/docker.sh b/.ci/scripts/linux/docker.sh index 5070b92d1..436155b3d 100755 --- a/.ci/scripts/linux/docker.sh +++ b/.ci/scripts/linux/docker.sh | |||
| @@ -3,8 +3,6 @@ | |||
| 3 | # Exit on error, rather than continuing with the rest of the script. | 3 | # Exit on error, rather than continuing with the rest of the script. |
| 4 | set -e | 4 | set -e |
| 5 | 5 | ||
| 6 | cd /yuzu | ||
| 7 | |||
| 8 | ccache -s | 6 | ccache -s |
| 9 | 7 | ||
| 10 | mkdir build || true && cd build | 8 | mkdir build || true && cd build |
| @@ -19,15 +17,16 @@ cmake .. \ | |||
| 19 | -DENABLE_QT_TRANSLATION=ON \ | 17 | -DENABLE_QT_TRANSLATION=ON \ |
| 20 | -DUSE_DISCORD_PRESENCE=ON \ | 18 | -DUSE_DISCORD_PRESENCE=ON \ |
| 21 | -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} \ | 19 | -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} \ |
| 22 | -DYUZU_USE_BUNDLED_FFMPEG=ON | 20 | -DYUZU_USE_BUNDLED_FFMPEG=ON \ |
| 21 | -GNinja | ||
| 23 | 22 | ||
| 24 | make -j$(nproc) | 23 | ninja |
| 25 | 24 | ||
| 26 | ccache -s | 25 | ccache -s |
| 27 | 26 | ||
| 28 | ctest -VV -C Release | 27 | ctest -VV -C Release |
| 29 | 28 | ||
| 30 | make install DESTDIR=AppDir | 29 | DESTDIR="$PWD/AppDir" ninja install |
| 31 | rm -vf AppDir/usr/bin/yuzu-cmd AppDir/usr/bin/yuzu-tester | 30 | rm -vf AppDir/usr/bin/yuzu-cmd AppDir/usr/bin/yuzu-tester |
| 32 | 31 | ||
| 33 | # Download tools needed to build an AppImage | 32 | # Download tools needed to build an AppImage |
diff --git a/.ci/scripts/linux/exec.sh b/.ci/scripts/linux/exec.sh index a7deddeb3..fc4594d65 100644 --- a/.ci/scripts/linux/exec.sh +++ b/.ci/scripts/linux/exec.sh | |||
| @@ -4,5 +4,5 @@ mkdir -p "ccache" || true | |||
| 4 | chmod a+x ./.ci/scripts/linux/docker.sh | 4 | chmod a+x ./.ci/scripts/linux/docker.sh |
| 5 | # the UID for the container yuzu user is 1027 | 5 | # the UID for the container yuzu user is 1027 |
| 6 | sudo chown -R 1027 ./ | 6 | sudo chown -R 1027 ./ |
| 7 | docker run -e ENABLE_COMPATIBILITY_REPORTING -e CCACHE_DIR=/yuzu/ccache -v $(pwd):/yuzu yuzuemu/build-environments:linux-fresh /bin/bash /yuzu/.ci/scripts/linux/docker.sh $1 | 7 | docker run -e ENABLE_COMPATIBILITY_REPORTING -e CCACHE_DIR=/yuzu/ccache -v "$(pwd):/yuzu" -w /yuzu yuzuemu/build-environments:linux-fresh /bin/bash /yuzu/.ci/scripts/linux/docker.sh "$1" |
| 8 | sudo chown -R $UID ./ | 8 | sudo chown -R $UID ./ |
diff --git a/.ci/scripts/linux/upload.sh b/.ci/scripts/linux/upload.sh index 208cd0d04..3f2c2f208 100644..100755 --- a/.ci/scripts/linux/upload.sh +++ b/.ci/scripts/linux/upload.sh | |||
| @@ -24,6 +24,11 @@ cd build | |||
| 24 | wget -nc https://github.com/yuzu-emu/ext-linux-bin/raw/main/appimage/appimagetool-x86_64.AppImage | 24 | wget -nc https://github.com/yuzu-emu/ext-linux-bin/raw/main/appimage/appimagetool-x86_64.AppImage |
| 25 | chmod 755 appimagetool-x86_64.AppImage | 25 | chmod 755 appimagetool-x86_64.AppImage |
| 26 | 26 | ||
| 27 | # if FUSE is not available, then fallback to extract and run | ||
| 28 | if ! ./appimagetool-x86_64.AppImage --version; then | ||
| 29 | export APPIMAGE_EXTRACT_AND_RUN=1 | ||
| 30 | fi | ||
| 31 | |||
| 27 | if [ "${RELEASE_NAME}" = "mainline" ]; then | 32 | if [ "${RELEASE_NAME}" = "mainline" ]; then |
| 28 | # Generate update information if releasing to mainline | 33 | # Generate update information if releasing to mainline |
| 29 | ./appimagetool-x86_64.AppImage -u "gh-releases-zsync|yuzu-emu|yuzu-${RELEASE_NAME}|latest|yuzu-*.AppImage.zsync" AppDir "${APPIMAGE_NAME}" | 34 | ./appimagetool-x86_64.AppImage -u "gh-releases-zsync|yuzu-emu|yuzu-${RELEASE_NAME}|latest|yuzu-*.AppImage.zsync" AppDir "${APPIMAGE_NAME}" |
diff --git a/.ci/scripts/windows/docker.sh b/.ci/scripts/windows/docker.sh index f53d837d1..d670fe47d 100755 --- a/.ci/scripts/windows/docker.sh +++ b/.ci/scripts/windows/docker.sh | |||
| @@ -2,19 +2,23 @@ | |||
| 2 | 2 | ||
| 3 | set -e | 3 | set -e |
| 4 | 4 | ||
| 5 | cd /yuzu | 5 | #cd /yuzu |
| 6 | 6 | ||
| 7 | ccache -s | 7 | ccache -sv |
| 8 | 8 | ||
| 9 | mkdir build || true && cd build | 9 | mkdir -p "$HOME/.conan/profiles" |
| 10 | LDFLAGS="-fuse-ld=lld" | 10 | wget -c "https://github.com/yuzu-emu/build-environments/raw/master/linux-mingw/default" -O "$HOME/.conan/profiles/default" |
| 11 | wget -c "https://github.com/yuzu-emu/build-environments/raw/master/linux-mingw/settings.yml" -O "$HOME/.conan/settings.yml" | ||
| 12 | |||
| 13 | mkdir -p build && cd build | ||
| 14 | export LDFLAGS="-fuse-ld=lld" | ||
| 11 | # -femulated-tls required due to an incompatibility between GCC and Clang | 15 | # -femulated-tls required due to an incompatibility between GCC and Clang |
| 12 | # TODO(lat9nq): If this is widespread, we probably need to add this to CMakeLists where appropriate | 16 | # TODO(lat9nq): If this is widespread, we probably need to add this to CMakeLists where appropriate |
| 17 | export CXXFLAGS="-femulated-tls" | ||
| 13 | cmake .. \ | 18 | cmake .. \ |
| 14 | -DCMAKE_BUILD_TYPE=Release \ | 19 | -DCMAKE_BUILD_TYPE=Release \ |
| 15 | -DCMAKE_CXX_FLAGS="-femulated-tls" \ | 20 | -DCMAKE_TOOLCHAIN_FILE="${PWD}/../CMakeModules/MinGWClangCross.cmake" \ |
| 16 | -DCMAKE_TOOLCHAIN_FILE="$(pwd)/../CMakeModules/MinGWClangCross.cmake" \ | 21 | -DDISPLAY_VERSION="$1" \ |
| 17 | -DDISPLAY_VERSION=$1 \ | ||
| 18 | -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \ | 22 | -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \ |
| 19 | -DENABLE_QT_TRANSLATION=ON \ | 23 | -DENABLE_QT_TRANSLATION=ON \ |
| 20 | -DUSE_CCACHE=ON \ | 24 | -DUSE_CCACHE=ON \ |
| @@ -23,7 +27,7 @@ cmake .. \ | |||
| 23 | -GNinja | 27 | -GNinja |
| 24 | ninja yuzu yuzu-cmd | 28 | ninja yuzu yuzu-cmd |
| 25 | 29 | ||
| 26 | ccache -s | 30 | ccache -sv |
| 27 | 31 | ||
| 28 | echo "Tests skipped" | 32 | echo "Tests skipped" |
| 29 | #ctest -VV -C Release | 33 | #ctest -VV -C Release |
diff --git a/.ci/scripts/windows/exec.sh b/.ci/scripts/windows/exec.sh index f904544bd..bf5c5fb63 100644 --- a/.ci/scripts/windows/exec.sh +++ b/.ci/scripts/windows/exec.sh | |||
| @@ -4,5 +4,5 @@ mkdir -p "ccache" || true | |||
| 4 | chmod a+x ./.ci/scripts/windows/docker.sh | 4 | chmod a+x ./.ci/scripts/windows/docker.sh |
| 5 | # the UID for the container yuzu user is 1027 | 5 | # the UID for the container yuzu user is 1027 |
| 6 | sudo chown -R 1027 ./ | 6 | sudo chown -R 1027 ./ |
| 7 | docker run -e CCACHE_DIR=/yuzu/ccache -v $(pwd):/yuzu yuzuemu/build-environments:linux-mingw /bin/bash -ex /yuzu/.ci/scripts/windows/docker.sh $1 | 7 | docker run -e CCACHE_DIR=/yuzu/ccache -v "$(pwd):/yuzu" -w /yuzu yuzuemu/build-environments:linux-mingw /bin/bash -ex /yuzu/.ci/scripts/windows/docker.sh "$1" |
| 8 | sudo chown -R $UID ./ | 8 | sudo chown -R $UID ./ |
diff --git a/.ci/scripts/windows/upload.sh b/.ci/scripts/windows/upload.sh index 3c6a74218..3c6a74218 100644..100755 --- a/.ci/scripts/windows/upload.sh +++ b/.ci/scripts/windows/upload.sh | |||
diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml new file mode 100644 index 000000000..7e39ef847 --- /dev/null +++ b/.github/workflows/verify.yml | |||
| @@ -0,0 +1,115 @@ | |||
| 1 | name: 'yuzu verify' | ||
| 2 | |||
| 3 | on: | ||
| 4 | pull_request: | ||
| 5 | branches: [ master ] | ||
| 6 | |||
| 7 | jobs: | ||
| 8 | format: | ||
| 9 | name: 'verify format' | ||
| 10 | runs-on: ubuntu-latest | ||
| 11 | container: | ||
| 12 | image: yuzuemu/build-environments:linux-clang-format | ||
| 13 | options: -u 1001 | ||
| 14 | steps: | ||
| 15 | - uses: actions/checkout@v2 | ||
| 16 | with: | ||
| 17 | submodules: false | ||
| 18 | - name: 'Verify Formatting' | ||
| 19 | run: bash -ex ./.ci/scripts/format/script.sh | ||
| 20 | build: | ||
| 21 | name: 'test build' | ||
| 22 | needs: format | ||
| 23 | runs-on: ubuntu-latest | ||
| 24 | strategy: | ||
| 25 | fail-fast: false | ||
| 26 | matrix: | ||
| 27 | include: | ||
| 28 | - type: clang | ||
| 29 | image: linux-fresh | ||
| 30 | - type: linux | ||
| 31 | image: linux-fresh | ||
| 32 | - type: windows | ||
| 33 | image: linux-mingw | ||
| 34 | container: | ||
| 35 | image: yuzuemu/build-environments:${{ matrix.image }} | ||
| 36 | options: -u 1001 | ||
| 37 | steps: | ||
| 38 | - uses: actions/checkout@v2 | ||
| 39 | with: | ||
| 40 | submodules: recursive | ||
| 41 | fetch-depth: 0 | ||
| 42 | - name: Set up cache | ||
| 43 | uses: actions/cache@v2 | ||
| 44 | id: ccache-restore | ||
| 45 | with: | ||
| 46 | path: ~/.ccache | ||
| 47 | key: ${{ runner.os }}-${{ matrix.type }}-${{ github.sha }} | ||
| 48 | restore-keys: | | ||
| 49 | ${{ runner.os }}-${{ matrix.type }}- | ||
| 50 | - name: Create ccache directory | ||
| 51 | if: steps.ccache-restore.outputs.cache-hit != 'true' | ||
| 52 | run: mkdir -p ~/.ccache | ||
| 53 | - name: Build | ||
| 54 | run: ./.ci/scripts/${{ matrix.type }}/docker.sh | ||
| 55 | env: | ||
| 56 | ENABLE_COMPATIBILITY_REPORTING: "ON" | ||
| 57 | - name: Pack | ||
| 58 | run: ./.ci/scripts/${{ matrix.type }}/upload.sh | ||
| 59 | env: | ||
| 60 | NO_SOURCE_PACK: "YES" | ||
| 61 | - name: Upload | ||
| 62 | uses: actions/upload-artifact@v3 | ||
| 63 | with: | ||
| 64 | name: ${{ matrix.type }} | ||
| 65 | path: artifacts/ | ||
| 66 | build-msvc: | ||
| 67 | name: 'test build (windows, msvc)' | ||
| 68 | needs: format | ||
| 69 | runs-on: windows-2019 | ||
| 70 | steps: | ||
| 71 | - name: Set up cache | ||
| 72 | uses: actions/cache@v2 | ||
| 73 | with: | ||
| 74 | path: ~/.buildcache | ||
| 75 | key: ${{ runner.os }}-msvc-${{ github.sha }} | ||
| 76 | restore-keys: | | ||
| 77 | ${{ runner.os }}-msvc- | ||
| 78 | - name: Install dependencies | ||
| 79 | # due to how chocolatey works, only cmd.exe is supported here | ||
| 80 | shell: cmd | ||
| 81 | run: | | ||
| 82 | choco install vulkan-sdk wget | ||
| 83 | python -m pip install --upgrade pip conan | ||
| 84 | call refreshenv | ||
| 85 | wget https://github.com/mbitsnbites/buildcache/releases/download/v0.27.6/buildcache-windows.zip | ||
| 86 | 7z x buildcache-windows.zip | ||
| 87 | copy buildcache\bin\buildcache.exe C:\ProgramData\chocolatey\bin | ||
| 88 | rmdir buildcache | ||
| 89 | echo %PATH% >> %GITHUB_PATH% | ||
| 90 | - name: Set up MSVC | ||
| 91 | uses: ilammy/msvc-dev-cmd@v1 | ||
| 92 | - uses: actions/checkout@v2 | ||
| 93 | with: | ||
| 94 | submodules: recursive | ||
| 95 | fetch-depth: 0 | ||
| 96 | - name: Configure | ||
| 97 | env: | ||
| 98 | CC: cl.exe | ||
| 99 | CXX: cl.exe | ||
| 100 | run: | | ||
| 101 | glslangValidator --version | ||
| 102 | mkdir build | ||
| 103 | cmake . -B build -GNinja -DCMAKE_TOOLCHAIN_FILE="CMakeModules/MSVCCache.cmake" -DUSE_CCACHE=ON -DYUZU_USE_BUNDLED_QT=1 -DYUZU_USE_BUNDLED_SDL2=1 -DYUZU_USE_QT_WEB_ENGINE=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DYUZU_ENABLE_COMPATIBILITY_REPORTING=ON -DUSE_DISCORD_PRESENCE=ON -DENABLE_QT_TRANSLATION=ON -DCMAKE_BUILD_TYPE=Release | ||
| 104 | - name: Build | ||
| 105 | run: cmake --build build | ||
| 106 | - name: Cache Summary | ||
| 107 | run: buildcache -s | ||
| 108 | - name: Pack | ||
| 109 | shell: pwsh | ||
| 110 | run: .\.ci\scripts\windows\upload.ps1 | ||
| 111 | - name: Upload | ||
| 112 | uses: actions/upload-artifact@v3 | ||
| 113 | with: | ||
| 114 | name: msvc | ||
| 115 | path: artifacts/ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt index be70c04ae..80a8d4ed8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -627,6 +627,14 @@ add_definitions(-DBOOST_ERROR_CODE_HEADER_ONLY | |||
| 627 | -DBOOST_DATE_TIME_NO_LIB | 627 | -DBOOST_DATE_TIME_NO_LIB |
| 628 | -DBOOST_REGEX_NO_LIB | 628 | -DBOOST_REGEX_NO_LIB |
| 629 | ) | 629 | ) |
| 630 | # Adjustments for MSVC + Ninja | ||
| 631 | if (MSVC AND CMAKE_GENERATOR STREQUAL "Ninja") | ||
| 632 | add_compile_options( | ||
| 633 | /wd4711 # function 'function' selected for automatic inline expansion | ||
| 634 | /wd4464 # relative include path contains '..' | ||
| 635 | /wd4820 # 'identifier1': '4' bytes padding added after data member 'identifier2' | ||
| 636 | ) | ||
| 637 | endif() | ||
| 630 | 638 | ||
| 631 | enable_testing() | 639 | enable_testing() |
| 632 | add_subdirectory(externals) | 640 | add_subdirectory(externals) |
diff --git a/CMakeModules/CopyYuzuFFmpegDeps.cmake b/CMakeModules/CopyYuzuFFmpegDeps.cmake index 26384e8b8..f5ab2806c 100644 --- a/CMakeModules/CopyYuzuFFmpegDeps.cmake +++ b/CMakeModules/CopyYuzuFFmpegDeps.cmake | |||
| @@ -2,5 +2,6 @@ function(copy_yuzu_FFmpeg_deps target_dir) | |||
| 2 | include(WindowsCopyFiles) | 2 | include(WindowsCopyFiles) |
| 3 | set(DLL_DEST "${CMAKE_BINARY_DIR}/bin/$<CONFIG>/") | 3 | set(DLL_DEST "${CMAKE_BINARY_DIR}/bin/$<CONFIG>/") |
| 4 | file(READ "${FFmpeg_PATH}/requirements.txt" FFmpeg_REQUIRED_DLLS) | 4 | file(READ "${FFmpeg_PATH}/requirements.txt" FFmpeg_REQUIRED_DLLS) |
| 5 | string(STRIP "${FFmpeg_REQUIRED_DLLS}" FFmpeg_REQUIRED_DLLS) | ||
| 5 | windows_copy_files(${target_dir} ${FFmpeg_DLL_DIR} ${DLL_DEST} ${FFmpeg_REQUIRED_DLLS}) | 6 | windows_copy_files(${target_dir} ${FFmpeg_DLL_DIR} ${DLL_DEST} ${FFmpeg_REQUIRED_DLLS}) |
| 6 | endfunction(copy_yuzu_FFmpeg_deps) | 7 | endfunction(copy_yuzu_FFmpeg_deps) |
diff --git a/CMakeModules/MSVCCache.cmake b/CMakeModules/MSVCCache.cmake new file mode 100644 index 000000000..8848e35ea --- /dev/null +++ b/CMakeModules/MSVCCache.cmake | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | # buildcache wrapper | ||
| 2 | OPTION(USE_CCACHE "Use buildcache for compilation" OFF) | ||
| 3 | IF(USE_CCACHE) | ||
| 4 | FIND_PROGRAM(CCACHE buildcache) | ||
| 5 | IF (CCACHE) | ||
| 6 | MESSAGE(STATUS "Using buildcache found in PATH") | ||
| 7 | SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE}) | ||
| 8 | SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE}) | ||
| 9 | ELSE(CCACHE) | ||
| 10 | MESSAGE(WARNING "USE_CCACHE enabled, but no buildcache executable found") | ||
| 11 | ENDIF(CCACHE) | ||
| 12 | ENDIF(USE_CCACHE) | ||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 39d038493..39ae573b2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt | |||
| @@ -36,7 +36,6 @@ if (MSVC) | |||
| 36 | # /GT - Supports fiber safety for data allocated using static thread-local storage | 36 | # /GT - Supports fiber safety for data allocated using static thread-local storage |
| 37 | add_compile_options( | 37 | add_compile_options( |
| 38 | /MP | 38 | /MP |
| 39 | /Zi | ||
| 40 | /Zm200 | 39 | /Zm200 |
| 41 | /Zo | 40 | /Zo |
| 42 | /permissive- | 41 | /permissive- |
| @@ -79,6 +78,13 @@ if (MSVC) | |||
| 79 | /we5245 # 'function': unreferenced function with internal linkage has been removed | 78 | /we5245 # 'function': unreferenced function with internal linkage has been removed |
| 80 | ) | 79 | ) |
| 81 | 80 | ||
| 81 | if (USE_CCACHE) | ||
| 82 | # when caching, we need to use /Z7 to downgrade debug info to use an older but more cachable format | ||
| 83 | add_compile_options(/Z7) | ||
| 84 | else() | ||
| 85 | add_compile_options(/Zi) | ||
| 86 | endif() | ||
| 87 | |||
| 82 | if (ARCHITECTURE_x86_64) | 88 | if (ARCHITECTURE_x86_64) |
| 83 | add_compile_options(/QIntel-jcc-erratum) | 89 | add_compile_options(/QIntel-jcc-erratum) |
| 84 | endif() | 90 | endif() |