From 854a73dee0c7285b7c138ec3a117d47f7ebe1a2b Mon Sep 17 00:00:00 2001 From: Scott Mansell Date: Sun, 29 Jan 2023 21:51:41 +1300 Subject: [PATCH] CMake/MSVC: Fix PCH disabled build --- Source/Core/Common/WindowsRegistry.h | 3 +++ Source/Core/Common/x64CPUDetect.cpp | 2 ++ Source/PCH/CMakeLists.txt | 9 +++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Source/Core/Common/WindowsRegistry.h b/Source/Core/Common/WindowsRegistry.h index 4472a37e0e..8a4705e7fe 100644 --- a/Source/Core/Common/WindowsRegistry.h +++ b/Source/Core/Common/WindowsRegistry.h @@ -1,6 +1,9 @@ #pragma once #include +#include + +#include "Common/CommonTypes.h" namespace WindowsRegistry { diff --git a/Source/Core/Common/x64CPUDetect.cpp b/Source/Core/Common/x64CPUDetect.cpp index dedf02c05e..11dfcf0b51 100644 --- a/Source/Core/Common/x64CPUDetect.cpp +++ b/Source/Core/Common/x64CPUDetect.cpp @@ -4,9 +4,11 @@ #include "Common/CPUDetect.h" #ifdef _WIN32 +#include #include #endif +#include #include #include #include diff --git a/Source/PCH/CMakeLists.txt b/Source/PCH/CMakeLists.txt index 2ee6adaa12..b1a6595284 100644 --- a/Source/PCH/CMakeLists.txt +++ b/Source/PCH/CMakeLists.txt @@ -2,6 +2,12 @@ # Instead of having one PCH per module, dolphin has one PCH shared between all modules. # So we need to implement PCH manually, rather than using the PCH support built into cmake +# linking against this interface libary will cause targets to enable PCH +add_library(use_pch INTERFACE) + +# Uncomment this return to disable PCH +#return() + add_library(build_pch pch.h pch.cpp) # fmt/format.h is included in the PCH @@ -30,8 +36,7 @@ add_custom_target(force_build_pch DEPENDS $/dolphin.pch ) -# linking against this interface libary will cause targets to enable PCH -add_library(use_pch INTERFACE) +# link the pch into anything that depends on use_pch target_link_libraries(use_pch INTERFACE build_pch) # targets which use the pch need these compile options