From 1e1d455a4d0640b4097ba42ea953c30c9be70980 Mon Sep 17 00:00:00 2001 From: tellowkrinkle Date: Wed, 15 Jul 2020 00:57:11 -0500 Subject: [PATCH] Use PCH with Clang (#3546) --- common/src/Utilities/CMakeLists.txt | 5 +++++ common/src/x86emitter/CMakeLists.txt | 4 ++++ pcsx2/CMakeLists.txt | 8 +++----- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/common/src/Utilities/CMakeLists.txt b/common/src/Utilities/CMakeLists.txt index 3eca6dec1d..0b09c1613b 100644 --- a/common/src/Utilities/CMakeLists.txt +++ b/common/src/Utilities/CMakeLists.txt @@ -117,3 +117,8 @@ set(UtilitiesFinalLibs add_pcsx2_lib(${Output} "${UtilitiesFinalSources}" "${UtilitiesFinalLibs}" "${UtilitiesFinalFlags}") add_pcsx2_lib(${Output}_NO_TLS "${UtilitiesFinalSources}" "${UtilitiesFinalLibs}" "${UtilitiesFinalFlags} -DPCSX2_THREAD_LOCAL=0") + +if(COMMAND target_precompile_headers) + target_precompile_headers(${Output} PRIVATE PrecompiledHeader.h) + target_precompile_headers(${Output}_NO_TLS PRIVATE PrecompiledHeader.h) +endif() diff --git a/common/src/x86emitter/CMakeLists.txt b/common/src/x86emitter/CMakeLists.txt index 44828825bc..764af21874 100644 --- a/common/src/x86emitter/CMakeLists.txt +++ b/common/src/x86emitter/CMakeLists.txt @@ -73,3 +73,7 @@ set(x86emitterFinalLibs ) add_pcsx2_lib(${Output} "${x86emitterFinalSources}" "${x86emitterFinalLibs}" "${x86emitterFinalFlags}") + +if(COMMAND target_precompile_headers) + target_precompile_headers(${Output} PRIVATE PrecompiledHeader.h) +endif() diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index ee13bdb45d..5026ba954e 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -714,11 +714,9 @@ endif() add_pcsx2_executable(${Output} "${pcsx2FinalSources}" "${pcsx2FinalLibs}" "${pcsx2FinalFlags}") -if(NOT USE_CLANG) - if(COMMAND target_precompile_headers) - message("Using precompiled headers.") - target_precompile_headers(${Output} PRIVATE PrecompiledHeader.h) - endif() +if(COMMAND target_precompile_headers) + message("Using precompiled headers.") + target_precompile_headers(${Output} PRIVATE PrecompiledHeader.h) endif() if (APPLE)