diff options
| author | 2022-11-29 23:01:32 -0500 | |
|---|---|---|
| committer | 2022-11-29 23:01:32 -0500 | |
| commit | 51358d2b5e05b476c450402da1351855fb723135 (patch) | |
| tree | ab202a0e1a61c98d148e17902cd33915b8dc5660 | |
| parent | CMake: Use precompiled headers (diff) | |
| download | yuzu-51358d2b5e05b476c450402da1351855fb723135.tar.gz yuzu-51358d2b5e05b476c450402da1351855fb723135.tar.xz yuzu-51358d2b5e05b476c450402da1351855fb723135.zip | |
CMake: Disable PCH on MSVC + Buildcache configs
Diffstat (limited to '')
| -rw-r--r-- | CMakeLists.txt | 14 | ||||
| -rw-r--r-- | src/CMakeLists.txt | 4 |
2 files changed, 14 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 901a04857..9a6536fd4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -66,6 +66,20 @@ elseif(NOT "$ENV{VCPKG_TOOLCHAIN_FILE}" STREQUAL "") | |||
| 66 | include("$ENV{VCPKG_TOOLCHAIN_FILE}") | 66 | include("$ENV{VCPKG_TOOLCHAIN_FILE}") |
| 67 | endif() | 67 | endif() |
| 68 | 68 | ||
| 69 | if (YUZU_USE_PRECOMPILED_HEADERS) | ||
| 70 | if (MSVC AND CCACHE) | ||
| 71 | # buildcache does not properly cache PCH files, leading to compilation errors. | ||
| 72 | # See https://github.com/mbitsnbites/buildcache/discussions/230 | ||
| 73 | message(WARNING "buildcache does not properly support Precompiled Headers. Disabling PCH") | ||
| 74 | set(YUZU_USE_PRECOMPILED_HEADERS OFF) | ||
| 75 | endif() | ||
| 76 | endif() | ||
| 77 | if (YUZU_USE_PRECOMPILED_HEADERS) | ||
| 78 | message(STATUS "Using Precompiled Headers.") | ||
| 79 | set(CMAKE_PCH_INSTANTIATE_TEMPLATES ON) | ||
| 80 | endif() | ||
| 81 | |||
| 82 | |||
| 69 | # Default to a Release build | 83 | # Default to a Release build |
| 70 | get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) | 84 | get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) |
| 71 | if (NOT IS_MULTI_CONFIG AND NOT CMAKE_BUILD_TYPE) | 85 | if (NOT IS_MULTI_CONFIG AND NOT CMAKE_BUILD_TYPE) |
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 25703e9d5..fc53e76b9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt | |||
| @@ -152,10 +152,6 @@ else() | |||
| 152 | endif() | 152 | endif() |
| 153 | endif() | 153 | endif() |
| 154 | 154 | ||
| 155 | if (YUZU_USE_PRECOMPILED_HEADERS) | ||
| 156 | set(CMAKE_PCH_INSTANTIATE_TEMPLATES ON) | ||
| 157 | endif() | ||
| 158 | |||
| 159 | add_subdirectory(common) | 155 | add_subdirectory(common) |
| 160 | add_subdirectory(core) | 156 | add_subdirectory(core) |
| 161 | add_subdirectory(audio_core) | 157 | add_subdirectory(audio_core) |