diff options
| author | 2021-12-23 18:23:02 -0700 | |
|---|---|---|
| committer | 2022-07-04 21:21:56 -0600 | |
| commit | 40493231edad7085544b79b6c3ac7360d112170c (patch) | |
| tree | 5124d6fde6ca6b913c13aca60620c134e3bcf3f1 | |
| parent | CI: use Ninja to build stuff faster (diff) | |
| download | yuzu-40493231edad7085544b79b6c3ac7360d112170c.tar.gz yuzu-40493231edad7085544b79b6c3ac7360d112170c.tar.xz yuzu-40493231edad7085544b79b6c3ac7360d112170c.zip | |
CI: fix caching
| -rwxr-xr-x | .ci/scripts/windows/docker.sh | 4 | ||||
| -rw-r--r-- | .github/workflows/verify.yml | 51 | ||||
| -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 |
6 files changed, 78 insertions, 6 deletions
diff --git a/.ci/scripts/windows/docker.sh b/.ci/scripts/windows/docker.sh index 46cdb68f5..d0c70bf09 100755 --- a/.ci/scripts/windows/docker.sh +++ b/.ci/scripts/windows/docker.sh | |||
| @@ -4,7 +4,7 @@ set -e | |||
| 4 | 4 | ||
| 5 | #cd /yuzu | 5 | #cd /yuzu |
| 6 | 6 | ||
| 7 | ccache -s | 7 | ccache -sv |
| 8 | 8 | ||
| 9 | mkdir -p "$HOME/.conan/profiles" | 9 | mkdir -p "$HOME/.conan/profiles" |
| 10 | wget -nc "https://github.com/yuzu-emu/build-environments/raw/master/linux-mingw/default" -O "$HOME/.conan/profiles/default" | 10 | wget -nc "https://github.com/yuzu-emu/build-environments/raw/master/linux-mingw/default" -O "$HOME/.conan/profiles/default" |
| @@ -28,7 +28,7 @@ cmake .. \ | |||
| 28 | -GNinja | 28 | -GNinja |
| 29 | ninja yuzu yuzu-cmd | 29 | ninja yuzu yuzu-cmd |
| 30 | 30 | ||
| 31 | ccache -s | 31 | ccache -sv |
| 32 | 32 | ||
| 33 | echo "Tests skipped" | 33 | echo "Tests skipped" |
| 34 | #ctest -VV -C Release | 34 | #ctest -VV -C Release |
diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index e601ecd40..d26ebc3ac 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml | |||
| @@ -6,7 +6,7 @@ on: | |||
| 6 | 6 | ||
| 7 | jobs: | 7 | jobs: |
| 8 | format: | 8 | format: |
| 9 | name: 'verify formatting' | 9 | name: 'verify format' |
| 10 | runs-on: ubuntu-latest | 10 | runs-on: ubuntu-latest |
| 11 | container: | 11 | container: |
| 12 | image: yuzuemu/build-environments:linux-clang-format | 12 | image: yuzuemu/build-environments:linux-clang-format |
| @@ -41,12 +41,57 @@ jobs: | |||
| 41 | fetch-depth: 0 | 41 | fetch-depth: 0 |
| 42 | - name: Set up cache | 42 | - name: Set up cache |
| 43 | uses: actions/cache@v2 | 43 | uses: actions/cache@v2 |
| 44 | id: ccache-restore | ||
| 44 | with: | 45 | with: |
| 45 | path: ~/.ccache | 46 | path: ~/.ccache |
| 46 | key: ${{ runner.os }}-${{ matrix.image }}-${{ github.sha }} | 47 | key: ${{ runner.os }}-${{ matrix.type }}-${{ github.sha }} |
| 47 | restore-keys: | | 48 | restore-keys: | |
| 48 | ${{ runner.os }}-${{ matrix.image }}- | 49 | ${{ runner.os }}-${{ matrix.type }}- |
| 50 | - name: Create ccache directory | ||
| 51 | if: steps.ccache-restore.outputs.cache-hit != 'true' | ||
| 52 | run: mkdir -p ~/.ccache | ||
| 49 | - name: Build | 53 | - name: Build |
| 50 | run: ./.ci/scripts/${{ matrix.type }}/docker.sh | 54 | run: ./.ci/scripts/${{ matrix.type }}/docker.sh |
| 51 | env: | 55 | env: |
| 52 | ENABLE_COMPATIBILITY_REPORTING: "ON" | 56 | ENABLE_COMPATIBILITY_REPORTING: "ON" |
| 57 | build-msvc: | ||
| 58 | name: 'test build (windows, msvc)' | ||
| 59 | needs: format | ||
| 60 | runs-on: windows-2019 | ||
| 61 | steps: | ||
| 62 | - name: Set up cache | ||
| 63 | uses: actions/cache@v2 | ||
| 64 | with: | ||
| 65 | path: ~/.buildcache | ||
| 66 | key: ${{ runner.os }}-msvc-${{ github.sha }} | ||
| 67 | restore-keys: | | ||
| 68 | ${{ runner.os }}-msvc- | ||
| 69 | - name: Install dependencies | ||
| 70 | shell: cmd | ||
| 71 | run: | | ||
| 72 | choco install vulkan-sdk wget | ||
| 73 | python -m pip install --upgrade pip conan | ||
| 74 | call refreshenv | ||
| 75 | wget https://github.com/mbitsnbites/buildcache/releases/download/v0.27.6/buildcache-windows.zip | ||
| 76 | 7z x buildcache-windows.zip | ||
| 77 | copy buildcache\bin\buildcache.exe C:\ProgramData\chocolatey\bin | ||
| 78 | rmdir buildcache | ||
| 79 | echo %PATH% >> %GITHUB_PATH% | ||
| 80 | - name: Set up MSVC | ||
| 81 | uses: ilammy/msvc-dev-cmd@v1 | ||
| 82 | - uses: actions/checkout@v2 | ||
| 83 | with: | ||
| 84 | submodules: recursive | ||
| 85 | fetch-depth: 0 | ||
| 86 | - name: Configure | ||
| 87 | env: | ||
| 88 | CC: cl.exe | ||
| 89 | CXX: cl.exe | ||
| 90 | run: | | ||
| 91 | glslangValidator --version | ||
| 92 | mkdir build | ||
| 93 | 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 | ||
| 94 | - name: Build | ||
| 95 | run: cmake --build build | ||
| 96 | - name: Cache Summary | ||
| 97 | run: buildcache -s | ||
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() |