Port yuzu-emu/yuzu#9300: "CMake: Use precompiled headers to improve compile times" (#6213)

Co-authored-by: Ameer J <52414509+ameerj@users.noreply.github.com>
This commit is contained in:
Tobias 2022-12-17 16:06:38 +01:00 committed by GitHub
parent 51e252c7ed
commit ccb50e7f2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 173 additions and 5 deletions

View file

@ -60,6 +60,7 @@ if (MSVC)
else()
add_compile_options(
/MP
/Zo
/permissive-
/EHsc
/volatile:iso
@ -88,11 +89,11 @@ if (MSVC)
# Since MSVC's debugging information is not very deterministic, so we have to disable it
# when using ccache or other caching tools
if (NOT CITRA_USE_CCACHE)
add_compile_options(
/Zi
/Zo
)
if (CITRA_USE_CCACHE OR CITRA_USE_PRECOMPILED_HEADERS)
# 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)
endif()
# /GS- - No stack buffer overflow checks