From f3d9b67d429e9e94eb54c0776caf20ae3897474e Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Tue, 5 Jul 2022 12:58:44 +0200 Subject: [PATCH] early-access version 2816 --- CMakeLists.txt | 8 ++++++++ CMakeModules/CopyYuzuFFmpegDeps.cmake | 1 + CMakeModules/MSVCCache.cmake | 12 ++++++++++++ README.md | 2 +- src/CMakeLists.txt | 8 +++++++- 5 files changed, 29 insertions(+), 2 deletions(-) create mode 100755 CMakeModules/MSVCCache.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index be70c04ae..80a8d4ed8 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -627,6 +627,14 @@ add_definitions(-DBOOST_ERROR_CODE_HEADER_ONLY -DBOOST_DATE_TIME_NO_LIB -DBOOST_REGEX_NO_LIB ) +# Adjustments for MSVC + Ninja +if (MSVC AND CMAKE_GENERATOR STREQUAL "Ninja") + add_compile_options( + /wd4711 # function 'function' selected for automatic inline expansion + /wd4464 # relative include path contains '..' + /wd4820 # 'identifier1': '4' bytes padding added after data member 'identifier2' + ) +endif() enable_testing() add_subdirectory(externals) diff --git a/CMakeModules/CopyYuzuFFmpegDeps.cmake b/CMakeModules/CopyYuzuFFmpegDeps.cmake index 26384e8b8..f5ab2806c 100755 --- a/CMakeModules/CopyYuzuFFmpegDeps.cmake +++ b/CMakeModules/CopyYuzuFFmpegDeps.cmake @@ -2,5 +2,6 @@ function(copy_yuzu_FFmpeg_deps target_dir) include(WindowsCopyFiles) set(DLL_DEST "${CMAKE_BINARY_DIR}/bin/$/") file(READ "${FFmpeg_PATH}/requirements.txt" FFmpeg_REQUIRED_DLLS) + string(STRIP "${FFmpeg_REQUIRED_DLLS}" FFmpeg_REQUIRED_DLLS) windows_copy_files(${target_dir} ${FFmpeg_DLL_DIR} ${DLL_DEST} ${FFmpeg_REQUIRED_DLLS}) endfunction(copy_yuzu_FFmpeg_deps) diff --git a/CMakeModules/MSVCCache.cmake b/CMakeModules/MSVCCache.cmake new file mode 100755 index 000000000..2c8b20187 --- /dev/null +++ b/CMakeModules/MSVCCache.cmake @@ -0,0 +1,12 @@ +# buildcache wrapper +OPTION(USE_CCACHE "Use buildcache for compilation" OFF) +IF(USE_CCACHE) + FIND_PROGRAM(CCACHE buildcache) + IF (CCACHE) + MESSAGE(STATUS "Using buildcache found in PATH") + SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE}) + SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE}) + ELSE(CCACHE) + MESSAGE(WARNING "USE_CCACHE enabled, but no buildcache executable found") + ENDIF(CCACHE) +ENDIF(USE_CCACHE) diff --git a/README.md b/README.md index ed2d2ecb6..861e84808 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 2815. +This is the source code for early-access 2816. ## Legal Notice diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 348c896df..c0677fbc4 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -36,7 +36,6 @@ if (MSVC) # /GT - Supports fiber safety for data allocated using static thread-local storage add_compile_options( /MP - /Zi /Zm200 /Zo /permissive- @@ -79,6 +78,13 @@ if (MSVC) /we5245 # 'function': unreferenced function with internal linkage has been removed ) + if (USE_CCACHE) + # when caching, we need to use /Z7 to downgrade debug info to use an older but more cachable format + add_compile_options(/Z7) + else() + add_compile_options(/Zi) + endif() + if (ARCHITECTURE_x86_64) add_compile_options(/QIntel-jcc-erratum) endif()