mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-09 23:59:27 +01:00
CMake/MSVC: Fix PCH disabled build
This commit is contained in:
parent
1956ce151f
commit
854a73dee0
@ -1,6 +1,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include "Common/CommonTypes.h"
|
||||||
|
|
||||||
namespace WindowsRegistry
|
namespace WindowsRegistry
|
||||||
{
|
{
|
||||||
|
@ -4,9 +4,11 @@
|
|||||||
#include "Common/CPUDetect.h"
|
#include "Common/CPUDetect.h"
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
#include <windows.h>
|
||||||
#include <processthreadsapi.h>
|
#include <processthreadsapi.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
@ -2,6 +2,12 @@
|
|||||||
# Instead of having one PCH per module, dolphin has one PCH shared between all modules.
|
# 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
|
# 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)
|
add_library(build_pch pch.h pch.cpp)
|
||||||
|
|
||||||
# fmt/format.h is included in the PCH
|
# fmt/format.h is included in the PCH
|
||||||
@ -30,8 +36,7 @@ add_custom_target(force_build_pch
|
|||||||
DEPENDS $<TARGET_FILE_DIR:build_pch>/dolphin.pch
|
DEPENDS $<TARGET_FILE_DIR:build_pch>/dolphin.pch
|
||||||
)
|
)
|
||||||
|
|
||||||
# linking against this interface libary will cause targets to enable PCH
|
# link the pch into anything that depends on use_pch
|
||||||
add_library(use_pch INTERFACE)
|
|
||||||
target_link_libraries(use_pch INTERFACE build_pch)
|
target_link_libraries(use_pch INTERFACE build_pch)
|
||||||
|
|
||||||
# targets which use the pch need these compile options
|
# targets which use the pch need these compile options
|
||||||
|
Loading…
x
Reference in New Issue
Block a user