summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar ameerj2022-11-29 23:01:32 -0500
committerGravatar ameerj2022-11-29 23:01:32 -0500
commit51358d2b5e05b476c450402da1351855fb723135 (patch)
treeab202a0e1a61c98d148e17902cd33915b8dc5660
parentCMake: Use precompiled headers (diff)
downloadyuzu-51358d2b5e05b476c450402da1351855fb723135.tar.gz
yuzu-51358d2b5e05b476c450402da1351855fb723135.tar.xz
yuzu-51358d2b5e05b476c450402da1351855fb723135.zip
CMake: Disable PCH on MSVC + Buildcache configs
Diffstat (limited to '')
-rw-r--r--CMakeLists.txt14
-rw-r--r--src/CMakeLists.txt4
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}")
67endif() 67endif()
68 68
69if (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()
76endif()
77if (YUZU_USE_PRECOMPILED_HEADERS)
78 message(STATUS "Using Precompiled Headers.")
79 set(CMAKE_PCH_INSTANTIATE_TEMPLATES ON)
80endif()
81
82
69# Default to a Release build 83# Default to a Release build
70get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) 84get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
71if (NOT IS_MULTI_CONFIG AND NOT CMAKE_BUILD_TYPE) 85if (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()
153endif() 153endif()
154 154
155if (YUZU_USE_PRECOMPILED_HEADERS)
156 set(CMAKE_PCH_INSTANTIATE_TEMPLATES ON)
157endif()
158
159add_subdirectory(common) 155add_subdirectory(common)
160add_subdirectory(core) 156add_subdirectory(core)
161add_subdirectory(audio_core) 157add_subdirectory(audio_core)