From 37bc5118ea8f5891741faba8963ce9ae5f88e946 Mon Sep 17 00:00:00 2001 From: ameerj <52414509+ameerj@users.noreply.github.com> Date: Tue, 22 Nov 2022 18:38:23 -0500 Subject: CMake: Use precompiled headers --- src/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/CMakeLists.txt') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0ac3d254e..25703e9d5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -82,8 +82,9 @@ if (MSVC) /wd4324 # 'struct_name': structure was padded due to __declspec(align()) ) - if (USE_CCACHE) + if (USE_CCACHE OR YUZU_USE_PRECOMPILED_HEADERS) # when caching, we need to use /Z7 to downgrade debug info to use an older but more cachable format + # Precompiled headers are deleted if not using /Z7. See https://github.com/nanoant/CMakePCHCompiler/issues/21 add_compile_options(/Z7) else() add_compile_options(/Zi) @@ -151,6 +152,10 @@ 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) -- cgit v1.2.3 From 51358d2b5e05b476c450402da1351855fb723135 Mon Sep 17 00:00:00 2001 From: ameerj <52414509+ameerj@users.noreply.github.com> Date: Tue, 29 Nov 2022 23:01:32 -0500 Subject: CMake: Disable PCH on MSVC + Buildcache configs --- src/CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/CMakeLists.txt') 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) -- cgit v1.2.3