From 580c721c8252a6c6657e68f67bfe2cd37b9ba61b Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Sun, 22 May 2022 01:19:44 +0200 Subject: [PATCH] cmake: Don't use PCH with Qt6. --- Source/Core/AudioCommon/CMakeLists.txt | 5 +++++ Source/Core/Common/CMakeLists.txt | 3 +-- Source/Core/Core/CMakeLists.txt | 5 +++++ Source/Core/DiscIO/CMakeLists.txt | 5 +++++ Source/Core/DolphinNoGUI/CMakeLists.txt | 5 +++++ Source/Core/DolphinQt/CMakeLists.txt | 3 +++ Source/Core/DolphinTool/CMakeLists.txt | 5 +++++ Source/Core/InputCommon/CMakeLists.txt | 5 +++++ Source/Core/UICommon/CMakeLists.txt | 5 +++++ Source/Core/UpdaterCommon/CMakeLists.txt | 7 ++++++- Source/Core/VideoBackends/D3D/CMakeLists.txt | 5 +++++ Source/Core/VideoBackends/D3D12/CMakeLists.txt | 5 +++++ Source/Core/VideoBackends/D3DCommon/CMakeLists.txt | 5 +++++ Source/Core/VideoBackends/Null/CMakeLists.txt | 5 +++++ Source/Core/VideoBackends/OGL/CMakeLists.txt | 5 +++++ Source/Core/VideoBackends/Software/CMakeLists.txt | 5 +++++ Source/Core/VideoBackends/Vulkan/CMakeLists.txt | 5 +++++ Source/Core/VideoCommon/CMakeLists.txt | 5 +++++ Source/Core/WinUpdater/CMakeLists.txt | 5 +++++ 19 files changed, 90 insertions(+), 3 deletions(-) diff --git a/Source/Core/AudioCommon/CMakeLists.txt b/Source/Core/AudioCommon/CMakeLists.txt index dfa20f6194..b3a9c57b42 100644 --- a/Source/Core/AudioCommon/CMakeLists.txt +++ b/Source/Core/AudioCommon/CMakeLists.txt @@ -83,3 +83,8 @@ PRIVATE cubeb SoundTouch FreeSurround) + +if(MSVC) + # Add precompiled header + target_link_libraries(audiocommon PRIVATE use_pch) +endif() diff --git a/Source/Core/Common/CMakeLists.txt b/Source/Core/Common/CMakeLists.txt index 287680aeea..52448c9ea9 100644 --- a/Source/Core/Common/CMakeLists.txt +++ b/Source/Core/Common/CMakeLists.txt @@ -311,8 +311,7 @@ endif() if(MSVC) # Add precompiled header - # it will propergate down to everything that depends on common - target_link_libraries(common PUBLIC use_pch) + target_link_libraries(common PRIVATE use_pch) # We need to disable PCH for this one file, because it's C and our PCH is C++ set_source_files_properties( diff --git a/Source/Core/Core/CMakeLists.txt b/Source/Core/Core/CMakeLists.txt index 4063e01562..e9ac274a06 100644 --- a/Source/Core/Core/CMakeLists.txt +++ b/Source/Core/Core/CMakeLists.txt @@ -702,3 +702,8 @@ if(UNIX) MemoryWatcher.h ) endif() + +if(MSVC) + # Add precompiled header + target_link_libraries(core PRIVATE use_pch) +endif() diff --git a/Source/Core/DiscIO/CMakeLists.txt b/Source/Core/DiscIO/CMakeLists.txt index e9627d0156..68028dbcfc 100644 --- a/Source/Core/DiscIO/CMakeLists.txt +++ b/Source/Core/DiscIO/CMakeLists.txt @@ -77,3 +77,8 @@ PRIVATE pugixml ZLIB::ZLIB ) + +if(MSVC) + # Add precompiled header + target_link_libraries(discio PRIVATE use_pch) +endif() diff --git a/Source/Core/DolphinNoGUI/CMakeLists.txt b/Source/Core/DolphinNoGUI/CMakeLists.txt index 3943582ad2..f21955d809 100644 --- a/Source/Core/DolphinNoGUI/CMakeLists.txt +++ b/Source/Core/DolphinNoGUI/CMakeLists.txt @@ -26,6 +26,11 @@ PRIVATE cpp-optparse ) +if(MSVC) + # Add precompiled header + target_link_libraries(dolphin-nogui PRIVATE use_pch) +endif() + if(USE_DISCORD_PRESENCE) target_compile_definitions(dolphin-nogui PRIVATE -DUSE_DISCORD_PRESENCE) endif() diff --git a/Source/Core/DolphinQt/CMakeLists.txt b/Source/Core/DolphinQt/CMakeLists.txt index 3e19006952..4867d30e9d 100644 --- a/Source/Core/DolphinQt/CMakeLists.txt +++ b/Source/Core/DolphinQt/CMakeLists.txt @@ -396,6 +396,9 @@ if (MSVC) # Qt6 requires RTTI remove_cxx_flag_from_target(dolphin-emu "/GR-") target_compile_options(dolphin-emu PRIVATE "/GR") + else() + # Add precompiled header + target_link_libraries(audiocommon PRIVATE use_pch) endif() endif() diff --git a/Source/Core/DolphinTool/CMakeLists.txt b/Source/Core/DolphinTool/CMakeLists.txt index cba3b0218a..5e545225ec 100644 --- a/Source/Core/DolphinTool/CMakeLists.txt +++ b/Source/Core/DolphinTool/CMakeLists.txt @@ -19,5 +19,10 @@ PRIVATE cpp-optparse ) +if(MSVC) + # Add precompiled header + target_link_libraries(dolphin-tool PRIVATE use_pch) +endif() + set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} dolphin-tool) install(TARGETS dolphin-tool RUNTIME DESTINATION ${bindir}) diff --git a/Source/Core/InputCommon/CMakeLists.txt b/Source/Core/InputCommon/CMakeLists.txt index 4f9510d7a5..910d64d8d4 100644 --- a/Source/Core/InputCommon/CMakeLists.txt +++ b/Source/Core/InputCommon/CMakeLists.txt @@ -205,3 +205,8 @@ if(ENABLE_SDL) message(STATUS "SDL NOT found, disabling SDL input") endif() endif() + +if(MSVC) + # Add precompiled header + target_link_libraries(inputcommon PRIVATE use_pch) +endif() diff --git a/Source/Core/UICommon/CMakeLists.txt b/Source/Core/UICommon/CMakeLists.txt index 73cce4941c..2b7d5bd2a6 100644 --- a/Source/Core/UICommon/CMakeLists.txt +++ b/Source/Core/UICommon/CMakeLists.txt @@ -68,3 +68,8 @@ if(USE_DISCORD_PRESENCE) target_compile_definitions(uicommon PRIVATE -DUSE_DISCORD_PRESENCE) target_link_libraries(uicommon PRIVATE discord-rpc) endif() + +if(MSVC) + # Add precompiled header + target_link_libraries(uicommon PRIVATE use_pch) +endif() diff --git a/Source/Core/UpdaterCommon/CMakeLists.txt b/Source/Core/UpdaterCommon/CMakeLists.txt index e32907da71..c026cd577d 100644 --- a/Source/Core/UpdaterCommon/CMakeLists.txt +++ b/Source/Core/UpdaterCommon/CMakeLists.txt @@ -10,4 +10,9 @@ target_link_libraries(updatercommon PRIVATE ZLIB::ZLIB ed25519 cpp-optparse -) \ No newline at end of file +) + +if(MSVC) + # Add precompiled header + target_link_libraries(updatercommon PRIVATE use_pch) +endif() diff --git a/Source/Core/VideoBackends/D3D/CMakeLists.txt b/Source/Core/VideoBackends/D3D/CMakeLists.txt index b8ebb509b9..f296040526 100644 --- a/Source/Core/VideoBackends/D3D/CMakeLists.txt +++ b/Source/Core/VideoBackends/D3D/CMakeLists.txt @@ -29,3 +29,8 @@ PUBLIC videocommon videod3dcommon ) + +if(MSVC) + # Add precompiled header + target_link_libraries(videod3d PRIVATE use_pch) +endif() diff --git a/Source/Core/VideoBackends/D3D12/CMakeLists.txt b/Source/Core/VideoBackends/D3D12/CMakeLists.txt index 5b440775c0..16f458e2e9 100644 --- a/Source/Core/VideoBackends/D3D12/CMakeLists.txt +++ b/Source/Core/VideoBackends/D3D12/CMakeLists.txt @@ -35,3 +35,8 @@ PUBLIC videocommon videod3dcommon ) + +if(MSVC) + # Add precompiled header + target_link_libraries(videod3d12 PRIVATE use_pch) +endif() diff --git a/Source/Core/VideoBackends/D3DCommon/CMakeLists.txt b/Source/Core/VideoBackends/D3DCommon/CMakeLists.txt index c3eb521252..e4e586e47a 100644 --- a/Source/Core/VideoBackends/D3DCommon/CMakeLists.txt +++ b/Source/Core/VideoBackends/D3DCommon/CMakeLists.txt @@ -12,3 +12,8 @@ PUBLIC common videocommon ) + +if(MSVC) + # Add precompiled header + target_link_libraries(videod3dcommon PRIVATE use_pch) +endif() diff --git a/Source/Core/VideoBackends/Null/CMakeLists.txt b/Source/Core/VideoBackends/Null/CMakeLists.txt index 24ff04aaf0..e95877323f 100644 --- a/Source/Core/VideoBackends/Null/CMakeLists.txt +++ b/Source/Core/VideoBackends/Null/CMakeLists.txt @@ -17,3 +17,8 @@ PUBLIC common videocommon ) + +if(MSVC) + # Add precompiled header + target_link_libraries(videonull PRIVATE use_pch) +endif() diff --git a/Source/Core/VideoBackends/OGL/CMakeLists.txt b/Source/Core/VideoBackends/OGL/CMakeLists.txt index 8b4b27a571..9a9d9caf2d 100644 --- a/Source/Core/VideoBackends/OGL/CMakeLists.txt +++ b/Source/Core/VideoBackends/OGL/CMakeLists.txt @@ -33,3 +33,8 @@ PUBLIC PRIVATE ${X11_LIBRARIES} ) + +if(MSVC) + # Add precompiled header + target_link_libraries(videoogl PRIVATE use_pch) +endif() diff --git a/Source/Core/VideoBackends/Software/CMakeLists.txt b/Source/Core/VideoBackends/Software/CMakeLists.txt index 983cd3df3f..752fac48cc 100644 --- a/Source/Core/VideoBackends/Software/CMakeLists.txt +++ b/Source/Core/VideoBackends/Software/CMakeLists.txt @@ -41,3 +41,8 @@ PUBLIC common videocommon ) + +if(MSVC) + # Add precompiled header + target_link_libraries(videosoftware PRIVATE use_pch) +endif() diff --git a/Source/Core/VideoBackends/Vulkan/CMakeLists.txt b/Source/Core/VideoBackends/Vulkan/CMakeLists.txt index 74127f3aba..110733e613 100644 --- a/Source/Core/VideoBackends/Vulkan/CMakeLists.txt +++ b/Source/Core/VideoBackends/Vulkan/CMakeLists.txt @@ -62,3 +62,8 @@ SYSTEM PRIVATE ${CMAKE_SOURCE_DIR}/Externals/glslang/SPIRV ${CMAKE_SOURCE_DIR}/Externals/glslang ) + +if(MSVC) + # Add precompiled header + target_link_libraries(videovulkan PRIVATE use_pch) +endif() diff --git a/Source/Core/VideoCommon/CMakeLists.txt b/Source/Core/VideoCommon/CMakeLists.txt index 3504bc63d1..ec8f89c829 100644 --- a/Source/Core/VideoCommon/CMakeLists.txt +++ b/Source/Core/VideoCommon/CMakeLists.txt @@ -180,3 +180,8 @@ if(FFmpeg_FOUND) ) endif() endif() + +if(MSVC) + # Add precompiled header + target_link_libraries(videocommon PRIVATE use_pch) +endif() diff --git a/Source/Core/WinUpdater/CMakeLists.txt b/Source/Core/WinUpdater/CMakeLists.txt index d31ef9bacb..a57d039209 100644 --- a/Source/Core/WinUpdater/CMakeLists.txt +++ b/Source/Core/WinUpdater/CMakeLists.txt @@ -12,3 +12,8 @@ target_link_libraries(winupdater PRIVATE ) set_target_properties(winupdater PROPERTIES OUTPUT_NAME "Updater") + +if(MSVC) + # Add precompiled header + target_link_libraries(winupdater PRIVATE use_pch) +endif()