diff options
| author | Scott Mansell <phiren@gmail.com> | 2022-04-27 18:57:13 +1200 |
|---|---|---|
| committer | Admiral H. Curtiss <pikachu025@gmail.com> | 2022-05-22 00:29:47 +0200 |
| commit | 0909e0011748dcb47503a5a4e25c609aa11ceae8 (patch) | |
| tree | 52b23fd1887df0dee22d0030b71266d98ff0c4bb /Source/Core/Common | |
| parent | 2348017ee8ad11e7d12795f11353e989b25c1cb0 (diff) | |
cmake: fix MSVC PCH support
I'm not sure if the previous implementation ever worked.
Diffstat (limited to 'Source/Core/Common')
| -rw-r--r-- | Source/Core/Common/CMakeLists.txt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/Core/Common/CMakeLists.txt b/Source/Core/Common/CMakeLists.txt index e7cc3d88d8..984a143ce9 100644 --- a/Source/Core/Common/CMakeLists.txt +++ b/Source/Core/Common/CMakeLists.txt @@ -308,3 +308,14 @@ if(UNIX) elseif(WIN32) target_link_libraries(common PRIVATE "-INCLUDE:enableCompatPatches") endif() + +if(MSVC) + # Add precompiled header + # it will propergate down to everything that depends on common + target_link_libraries(common PUBLIC pch) + + # We need to disable PCH for this one file, because it's C and our PCH is C++ + set_source_files_properties( + ${CMAKE_CURRENT_SOURCE_DIR}/ImageC.c + PROPERTIES COMPILE_FLAGS "/Y- /I${CMAKE_SOURCE_DIR}/Source/PCH/nopch") +endif() |
