diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2022-11-30 05:01:32 +0100 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2022-11-30 05:01:32 +0100 |
commit | 51358d2b5e05b476c450402da1351855fb723135 (patch) | |
tree | ab202a0e1a61c98d148e17902cd33915b8dc5660 | |
parent | CMake: Use precompiled headers (diff) | |
download | yuzu-51358d2b5e05b476c450402da1351855fb723135.tar yuzu-51358d2b5e05b476c450402da1351855fb723135.tar.gz yuzu-51358d2b5e05b476c450402da1351855fb723135.tar.bz2 yuzu-51358d2b5e05b476c450402da1351855fb723135.tar.lz yuzu-51358d2b5e05b476c450402da1351855fb723135.tar.xz yuzu-51358d2b5e05b476c450402da1351855fb723135.tar.zst yuzu-51358d2b5e05b476c450402da1351855fb723135.zip |
-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 "") include("$ENV{VCPKG_TOOLCHAIN_FILE}") endif() +if (YUZU_USE_PRECOMPILED_HEADERS) + if (MSVC AND CCACHE) + # buildcache does not properly cache PCH files, leading to compilation errors. + # See https://github.com/mbitsnbites/buildcache/discussions/230 + message(WARNING "buildcache does not properly support Precompiled Headers. Disabling PCH") + set(YUZU_USE_PRECOMPILED_HEADERS OFF) + endif() +endif() +if (YUZU_USE_PRECOMPILED_HEADERS) + message(STATUS "Using Precompiled Headers.") + set(CMAKE_PCH_INSTANTIATE_TEMPLATES ON) +endif() + + # Default to a Release build get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) 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() endif() endif() -if (YUZU_USE_PRECOMPILED_HEADERS) - set(CMAKE_PCH_INSTANTIATE_TEMPLATES ON) -endif() - add_subdirectory(common) add_subdirectory(core) add_subdirectory(audio_core) |